Messages in this thread | | | Date | Mon, 28 Jun 2021 08:47:41 +0200 | From | Greg KH <> | Subject | Re: [PATCH] kernfs: Simplify if--else codes |
| |
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
| |