linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9p: Use BUG_ON instead of if condition followed by BUG.
@ 2021-11-12  9:25 cgel.zte
  2021-12-18 11:16 ` asmadeus
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-11-12  9:25 UTC (permalink / raw)
  To: ericvh
  Cc: lucho, asmadeus, v9fs-developer, linux-kernel, Zhang Mingyu, Zeal Robot

From: Zhang Mingyu <zhang.mingyu@zte.com.cn>

This issue was detected with the help of Coccinelle.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Zhang Mingyu <zhang.mingyu@zte.com.cn>
---
 fs/9p/vfs_file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 4244d48398ef..f2375448cafc 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -139,8 +139,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
 	fid = filp->private_data;
 	BUG_ON(fid == NULL);
 
-	if ((fl->fl_flags & FL_POSIX) != FL_POSIX)
-		BUG();
+	BUG_ON((fl->fl_flags & FL_POSIX) != FL_POSIX);
 
 	res = locks_lock_file_wait(filp, fl);
 	if (res < 0)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] 9p: Use BUG_ON instead of if condition followed by BUG.
  2021-11-12  9:25 [PATCH] 9p: Use BUG_ON instead of if condition followed by BUG cgel.zte
@ 2021-12-18 11:16 ` asmadeus
  0 siblings, 0 replies; 2+ messages in thread
From: asmadeus @ 2021-12-18 11:16 UTC (permalink / raw)
  To: cgel.zte
  Cc: ericvh, lucho, v9fs-developer, linux-kernel, Zhang Mingyu, Zeal Robot

cgel.zte@gmail.com wrote on Fri, Nov 12, 2021 at 09:25:47AM +0000:
> From: Zhang Mingyu <zhang.mingyu@zte.com.cn>
> 
> This issue was detected with the help of Coccinelle.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Zhang Mingyu <zhang.mingyu@zte.com.cn>

I realize I've never replied to this mail when applying old patches now,
I've picked this up too.

> ---
>  fs/9p/vfs_file.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
> index 4244d48398ef..f2375448cafc 100644
> --- a/fs/9p/vfs_file.c
> +++ b/fs/9p/vfs_file.c
> @@ -139,8 +139,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
>  	fid = filp->private_data;
>  	BUG_ON(fid == NULL);
>  
> -	if ((fl->fl_flags & FL_POSIX) != FL_POSIX)
> -		BUG();
> +	BUG_ON((fl->fl_flags & FL_POSIX) != FL_POSIX);
>  
>  	res = locks_lock_file_wait(filp, fl);
>  	if (res < 0)

-- 
Dominique

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-18 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  9:25 [PATCH] 9p: Use BUG_ON instead of if condition followed by BUG cgel.zte
2021-12-18 11:16 ` asmadeus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).