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>] [day] [month] [year] [list]
Date:   Mon, 28 Jun 2021 08:47:41 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     13145886936@....com
Cc:     tj@...nel.org, linux-kernel@...r.kernel.org,
        gushengxian <gushengxian@...ong.com>
Subject: Re: [PATCH] kernfs: Simplify if--else codes

On Sun, Jun 27, 2021 at 11:01:55PM -0700, 13145886936@....com wrote:
> From: gushengxian <gushengxian@...ong.com>
> 
> Simplify if--else codes.
> 
> Signed-off-by: gushengxian <13145886936@....com>
> Signed-off-by: gushengxian <gushengxian@...ong.com>
> ---
>  fs/kernfs/file.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
> index c75719312147..6bd531419f30 100644
> --- a/fs/kernfs/file.c
> +++ b/fs/kernfs/file.c
> @@ -644,10 +644,7 @@ static int kernfs_fop_open(struct inode *inode, struct file *file)
>  	 * Both paths of the branch look the same.  They're supposed to
>  	 * look that way and give @of->mutex different static lockdep keys.
>  	 */
> -	if (has_mmap)
> -		mutex_init(&of->mutex);
> -	else
> -		mutex_init(&of->mutex);
> +	mutex_init(&of->mutex);

Please always read the code, and the comments, you are modifying before
you modify it :(

This is a sign you are doing "blind" code cleanups.  Please stick with
drivers/staging/ for now as that part of the kernel accepts them much
easier than the rest of the kernel does.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ