All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] kernfs: Simplify if--else codes
       [not found] <20210628060155.1509993-1-13145886936@163.com>
@ 2021-06-28  6:47 ` Greg KH
  0 siblings, 0 replies; only message in thread
From: Greg KH @ 2021-06-28  6:47 UTC (permalink / raw)
  To: 13145886936; +Cc: tj, linux-kernel, gushengxian

On Sun, Jun 27, 2021 at 11:01:55PM -0700, 13145886936@163.com wrote:
> From: gushengxian <gushengxian@yulong.com>
> 
> Simplify if--else codes.
> 
> Signed-off-by: gushengxian <13145886936@163.com>
> Signed-off-by: gushengxian <gushengxian@yulong.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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-28  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210628060155.1509993-1-13145886936@163.com>
2021-06-28  6:47 ` [PATCH] kernfs: Simplify if--else codes Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.