Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ecryptfs: Drop cast

This patch does away with cast on void * and the if as it is unnecessary.

The following Coccinelle semantic patch was used for making the change:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>

authored by

Himangi Saraogi and committed by
Tyler Hicks
c4cf3ba4 9e78d14a

+1 -3
+1 -3
fs/ecryptfs/inode.c
··· 53 53 54 54 static int ecryptfs_inode_test(struct inode *inode, void *lower_inode) 55 55 { 56 - if (ecryptfs_inode_to_lower(inode) == (struct inode *)lower_inode) 57 - return 1; 58 - return 0; 56 + return ecryptfs_inode_to_lower(inode) == lower_inode; 59 57 } 60 58 61 59 static int ecryptfs_inode_set(struct inode *inode, void *opaque)