From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E026FC2B9F4 for ; Mon, 28 Jun 2021 06:47:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA97761A0F for ; Mon, 28 Jun 2021 06:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232260AbhF1GuK (ORCPT ); Mon, 28 Jun 2021 02:50:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:45028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbhF1GuJ (ORCPT ); Mon, 28 Jun 2021 02:50:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BB47619B6; Mon, 28 Jun 2021 06:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624862863; bh=j1K+vMODTMBa9yGZCvQC9vRUeL8g0T5aiKCSAl60vuM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0k0mCoCyi45DfFxb9GQeL1gJ3lSwIDvmzWdDdfusbrlucMPXkQJu81GJXDnfBMK2B j+BcftoZJfwAghDEa8xXFhLk92al7uYfsirA284b3wDwa73WlH+BB8pNOxSN/mRxXu hTEl6tsv2D6HCcMNtRUdG1u7lThAstKsy9qfRHJo= Date: Mon, 28 Jun 2021 08:47:41 +0200 From: Greg KH To: 13145886936@163.com Cc: tj@kernel.org, linux-kernel@vger.kernel.org, gushengxian Subject: Re: [PATCH] kernfs: Simplify if--else codes Message-ID: References: <20210628060155.1509993-1-13145886936@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210628060155.1509993-1-13145886936@163.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 27, 2021 at 11:01:55PM -0700, 13145886936@163.com wrote: > From: gushengxian > > Simplify if--else codes. > > Signed-off-by: gushengxian <13145886936@163.com> > Signed-off-by: gushengxian > --- > 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