2021-02-10 20:12:46

by kernel test robot

[permalink] [raw]
Subject: [PATCH] xfs: fix boolreturn.cocci warnings

From: kernel test robot <[email protected]>

fs/xfs/xfs_log.c:1062:9-10: WARNING: return of 0/1 in function 'xfs_log_need_covered' with return type bool

Return statements in functions returning bool should use
true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes: 37444fc4cc39 ("xfs: lift writable fs check up into log worker task")
CC: Brian Foster <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git xfs-5.12-merge
head: 560ab6c0d12ebccabb83638abe23a7875b946f9a
commit: 37444fc4cc398266fe0f71a9c0925620d44fb76a [25/36] xfs: lift writable fs check up into log worker task

xfs_log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1059,7 +1059,7 @@ xfs_log_need_covered(
bool needed = false;

if (!xlog_cil_empty(log))
- return 0;
+ return false;

spin_lock(&log->l_icloglock);
switch (log->l_covered_state) {


2021-02-10 21:07:56

by Brian Foster

[permalink] [raw]
Subject: Re: [PATCH] xfs: fix boolreturn.cocci warnings

On Thu, Feb 11, 2021 at 04:09:16AM +0800, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> fs/xfs/xfs_log.c:1062:9-10: WARNING: return of 0/1 in function 'xfs_log_need_covered' with return type bool
>
> Return statements in functions returning bool should use
> true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
>
> Fixes: 37444fc4cc39 ("xfs: lift writable fs check up into log worker task")
> CC: Brian Foster <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---

Reviewed-by: Brian Foster <[email protected]>

>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git xfs-5.12-merge
> head: 560ab6c0d12ebccabb83638abe23a7875b946f9a
> commit: 37444fc4cc398266fe0f71a9c0925620d44fb76a [25/36] xfs: lift writable fs check up into log worker task
>
> xfs_log.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -1059,7 +1059,7 @@ xfs_log_need_covered(
> bool needed = false;
>
> if (!xlog_cil_empty(log))
> - return 0;
> + return false;
>
> spin_lock(&log->l_icloglock);
> switch (log->l_covered_state) {
>

2021-02-10 22:29:38

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH] xfs: fix boolreturn.cocci warnings

On 2/10/21 12:11 PM, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> fs/xfs/xfs_log.c:1062:9-10: WARNING: return of 0/1 in function 'xfs_log_need_covered' with return type bool
>
> Return statements in functions returning bool should use
> true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
>
> Fixes: 37444fc4cc39 ("xfs: lift writable fs check up into log worker task")
> CC: Brian Foster <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git xfs-5.12-merge
> head: 560ab6c0d12ebccabb83638abe23a7875b946f9a
> commit: 37444fc4cc398266fe0f71a9c0925620d44fb76a [25/36] xfs: lift writable fs check up into log worker task
Looks good.

Reviewed-by: Chaitanya Kulkarni <[email protected]>