* [PATCH linux-next] qnx4: delete the unnecessary checks before brelse()
@ 2022-08-22 9:11 cgel.zte
2022-08-22 9:30 ` Anders Larsen
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-08-22 9:11 UTC (permalink / raw)
To: al, linux-kernel; +Cc: ye xingchen, Zeal Robot
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);
}
QNX4DEBUG((KERN_INFO "qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block));
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] qnx4: delete the unnecessary checks before brelse()
2022-08-22 9:11 [PATCH linux-next] qnx4: delete the unnecessary checks before brelse() cgel.zte
@ 2022-08-22 9:30 ` Anders Larsen
0 siblings, 0 replies; 2+ messages in thread
From: Anders Larsen @ 2022-08-22 9:30 UTC (permalink / raw)
To: ye xingchen; +Cc: linux-kernel, cgel.zte, Zeal Robot
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-22 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 9:11 [PATCH linux-next] qnx4: delete the unnecessary checks before brelse() cgel.zte
2022-08-22 9:30 ` Anders Larsen
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®