LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings
@ 2021-08-24  5:55 CGEL
  2021-10-14  9:26 ` Jan Kara
  2021-10-28 14:52 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: CGEL @ 2021-08-24  5:55 UTC (permalink / raw)
  To: tytso; +Cc: Andreas Dilger, linux-ext4, linux-kernel, Jing Yangyang, Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

Return statements in functions returning bool should use true/false
instead of 1/0.

./fs/ext4/namei.c:1441:12-13:WARNING:return of 0/1 in function
'ext4_match' with return type bool

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 fs/ext4/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index f3bbcd4..b5cb32d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1438,7 +1438,7 @@ static bool ext4_match(struct inode *parent,
 					fname->hinfo.minor_hash !=
 						EXT4_DIRENT_MINOR_HASH(de)) {
 
-					return 0;
+					return false;
 				}
 			}
 			return !ext4_ci_compare(parent, &cf, de->name,
-- 
1.8.3.1



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

* Re: [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings
  2021-08-24  5:55 [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings CGEL
@ 2021-10-14  9:26 ` Jan Kara
  2021-10-28 14:52 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2021-10-14  9:26 UTC (permalink / raw)
  To: CGEL
  Cc: tytso, Andreas Dilger, linux-ext4, linux-kernel, Jing Yangyang,
	Zeal Robot

On Mon 23-08-21 22:55:43, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Return statements in functions returning bool should use true/false
> instead of 1/0.
> 
> ./fs/ext4/namei.c:1441:12-13:WARNING:return of 0/1 in function
> 'ext4_match' with return type bool
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>

This seems to have fallen through the cracks. The fix looks good to me.
Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index f3bbcd4..b5cb32d 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -1438,7 +1438,7 @@ static bool ext4_match(struct inode *parent,
>  					fname->hinfo.minor_hash !=
>  						EXT4_DIRENT_MINOR_HASH(de)) {
>  
> -					return 0;
> +					return false;
>  				}
>  			}
>  			return !ext4_ci_compare(parent, &cf, de->name,
> -- 
> 1.8.3.1
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings
  2021-08-24  5:55 [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings CGEL
  2021-10-14  9:26 ` Jan Kara
@ 2021-10-28 14:52 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2021-10-28 14:52 UTC (permalink / raw)
  To: CGEL
  Cc: Theodore Ts'o, linux-ext4, Jing Yangyang, Andreas Dilger,
	Zeal Robot, linux-kernel

On Mon, 23 Aug 2021 22:55:43 -0700, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Return statements in functions returning bool should use true/false
> instead of 1/0.
> 
> ./fs/ext4/namei.c:1441:12-13:WARNING:return of 0/1 in function
> 'ext4_match' with return type bool
> 
> [...]

Applied, thanks!

[1/1] ext4:namei: fix boolreturn.cocci warnings
      commit: 79f75ac803a444eef5627b631e068fc442df3204

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

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

end of thread, other threads:[~2021-10-28 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  5:55 [PATCH linux-next] ext4:namei: fix boolreturn.cocci warnings CGEL
2021-10-14  9:26 ` Jan Kara
2021-10-28 14:52 ` Theodore Ts'o

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).