2021-05-16 09:46:32

by kernel test robot

[permalink] [raw]
Subject: [PATCH] scsi: target: tcmu: fix boolreturn.cocci warnings

From: kernel test robot <[email protected]>

drivers/target/target_core_user.c:1424:9-10: WARNING: return of 0/1 in function 'tcmu_handle_completions' 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: 9814b55cde05 ("scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found")
CC: Bodo Stroesser <[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/torvalds/linux.git master
head: c12a29ed9094b4b9cde8965c12850460b9a79d7c
commit: 9814b55cde0588b6d9bc496cee43f87316cbc6f1 scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
:::::: branch date: 6 hours ago
:::::: commit date: 2 weeks ago

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

--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1421,7 +1421,7 @@ static bool tcmu_handle_completions(stru

if (test_bit(TCMU_DEV_BIT_BROKEN, &udev->flags)) {
pr_err("ring broken, not handling completions\n");
- return 0;
+ return false;
}

mb = udev->mb_addr;


2021-05-16 17:15:43

by Bodo Stroesser

[permalink] [raw]
Subject: Re: [PATCH] scsi: target: tcmu: fix boolreturn.cocci warnings

On 16.05.21 01:03, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> drivers/target/target_core_user.c:1424:9-10: WARNING: return of 0/1 in function 'tcmu_handle_completions' 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: 9814b55cde05 ("scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found")
> CC: Bodo Stroesser <[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/torvalds/linux.git master
> head: c12a29ed9094b4b9cde8965c12850460b9a79d7c
> commit: 9814b55cde0588b6d9bc496cee43f87316cbc6f1 scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
> :::::: branch date: 6 hours ago
> :::::: commit date: 2 weeks ago
>
> target_core_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -1421,7 +1421,7 @@ static bool tcmu_handle_completions(stru
>
> if (test_bit(TCMU_DEV_BIT_BROKEN, &udev->flags)) {
> pr_err("ring broken, not handling completions\n");
> - return 0;
> + return false;
> }
>
> mb = udev->mb_addr;
>

Acked-by: Bodo Stroesser <[email protected]>

2021-05-21 21:16:30

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: target: tcmu: fix boolreturn.cocci warnings


> From: kernel test robot <[email protected]>
>
> drivers/target/target_core_user.c:1424:9-10: WARNING: return of 0/1 in function 'tcmu_handle_completions' 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

Applied to 5.14/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering

2021-05-26 04:32:40

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: target: tcmu: fix boolreturn.cocci warnings

On Sun, 16 May 2021 07:03:58 +0800, kernel test robot wrote:

> drivers/target/target_core_user.c:1424:9-10: WARNING: return of 0/1 in function 'tcmu_handle_completions' 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

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: target: tcmu: fix boolreturn.cocci warnings
https://git.kernel.org/mkp/scsi/c/824731258b65

--
Martin K. Petersen Oracle Linux Engineering