From: Anders Larsen <al@alarsen.net>
To: ye xingchen <ye.xingchen@zte.com.cn>
Cc: linux-kernel@vger.kernel.org, cgel.zte@gmail.com,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] qnx4: delete the unnecessary checks before brelse()
Date: Mon, 22 Aug 2022 11:30:23 +0200 [thread overview]
Message-ID: <5293718.Sb9uPGUboI@alarsen.net> (raw)
In-Reply-To: <20220822091152.204858-1-ye.xingchen@zte.com.cn>
On Monday, 2022-08-22 11:11 cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> The brelse() function tests whether its argument is NULL
> and then returns immediately.
> Thus remove the tests which are not needed around the shown calls.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
> fs/qnx4/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
> index 391ea402920d..9dab8f65ba75 100644
> --- a/fs/qnx4/inode.c
> +++ b/fs/qnx4/inode.c
> @@ -118,8 +118,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock )
> bh = NULL;
> }
> }
> - if ( bh )
> - brelse( bh );
> + brelse(bh);
When you remove the if() you must decrease the indentation of the following line!
> }
>
> QNX4DEBUG((KERN_INFO "qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block));
Other than that,
Acked-by: Anders Larsen <al@alarsen.net>
prev parent reply other threads:[~2022-08-22 9:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 9:11 cgel.zte
2022-08-22 9:30 ` Anders Larsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5293718.Sb9uPGUboI@alarsen.net \
--to=al@alarsen.net \
--cc=cgel.zte@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ye.xingchen@zte.com.cn \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®