lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 26 Jun 2014 14:50:52 -0500
From:	Tyler Hicks <tyhicks@...onical.com>
To:	Himangi Saraogi <himangi774@...il.com>
Cc:	ecryptfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	julia.lawall@...6.fr, Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v2] ecryptfs: Drop cast

On 2014-06-27 01:11:59, Himangi Saraogi wrote:
> 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@...il.com>
> ---
> v2: remove the if statement
>  fs/ecryptfs/inode.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Thanks! This looks good to me. I'll take the patch from here.

Tyler

> 
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index 4d6c7e4..e67f9f0 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -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)
> -- 
> 1.9.1
> 

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ