Skip to content

Commit

Permalink
ecryptfs: Drop cast
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tyler Hicks <[email protected]>
  • Loading branch information
himangi774 authored and tyhicks committed Jul 3, 2014
1 parent 9e78d14 commit c4cf3ba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ static void unlock_dir(struct dentry *dir)

static int ecryptfs_inode_test(struct inode *inode, void *lower_inode)
{
if (ecryptfs_inode_to_lower(inode) == (struct inode *)lower_inode)
return 1;
return 0;
return ecryptfs_inode_to_lower(inode) == lower_inode;
}

static int ecryptfs_inode_set(struct inode *inode, void *opaque)
Expand Down

0 comments on commit c4cf3ba

Please sign in to comment.