Linux-Raid Archives on lore.kernel.org
 help / color / Atom feed
* [song-md:md-next 15/16] drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' with return type bool
@ 2020-09-22  0:30 kernel test robot
  2020-09-22  0:30 ` [PATCH] md/raid10: fix boolreturn.cocci warnings kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-09-22  0:30 UTC (permalink / raw)
  To: Xiao Ni; +Cc: kbuild-all, linux-raid, Song Liu, Coly Li, Guoqing Jiang


[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
head:   5b2374a6c221f28c74913d208bb5376a7ee3bf70
commit: 8f694215ae4c7abf1e6c985803a1aad0db748d07 [15/16] md/raid10: improve raid10 discard request
config: i386-randconfig-c001-20200921 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' with return type bool

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29833 bytes --]

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

* [PATCH] md/raid10: fix boolreturn.cocci warnings
  2020-09-22  0:30 [song-md:md-next 15/16] drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' with return type bool kernel test robot
@ 2020-09-22  0:30 ` kernel test robot
  2020-09-22  5:48   ` Xiao Ni
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-09-22  0:30 UTC (permalink / raw)
  To: Xiao Ni; +Cc: kbuild-all, linux-raid, Song Liu, Coly Li, Guoqing Jiang

From: kernel test robot <lkp@intel.com>

drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' 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: 8f694215ae4c ("md/raid10: improve raid10 discard request")
CC: Xiao Ni <xni@redhat.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
head:   5b2374a6c221f28c74913d208bb5376a7ee3bf70
commit: 8f694215ae4c7abf1e6c985803a1aad0db748d07 [15/16] md/raid10: improve raid10 discard request

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

--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1760,7 +1760,7 @@ static bool raid10_handle_discard(struct
 		raid_end_bio_io(r10_bio);
 	}
 
-	return 0;
+	return false;
 out:
 	allow_barrier(conf);
 	return -EAGAIN;

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

* Re: [PATCH] md/raid10: fix boolreturn.cocci warnings
  2020-09-22  0:30 ` [PATCH] md/raid10: fix boolreturn.cocci warnings kernel test robot
@ 2020-09-22  5:48   ` Xiao Ni
  0 siblings, 0 replies; 3+ messages in thread
From: Xiao Ni @ 2020-09-22  5:48 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-raid, Song Liu, Coly Li, Guoqing Jiang



On 09/22/2020 08:30 AM, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
>
> drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' 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: 8f694215ae4c ("md/raid10: improve raid10 discard request")
> CC: Xiao Ni <xni@redhat.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
>
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
> head:   5b2374a6c221f28c74913d208bb5376a7ee3bf70
> commit: 8f694215ae4c7abf1e6c985803a1aad0db748d07 [15/16] md/raid10: improve raid10 discard request
>
>   raid10.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1760,7 +1760,7 @@ static bool raid10_handle_discard(struct
>   		raid_end_bio_io(r10_bio);
>   	}
>   
> -	return 0;
> +	return false;

Thanks for the patch. But it's not good to return false when 
raid10_handle_discard handles discard bio
successfully. I'll send one patch to fix this problem.

Regards
Xiao


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  0:30 [song-md:md-next 15/16] drivers/md/raid10.c:1763:8-9: WARNING: return of 0/1 in function 'raid10_handle_discard' with return type bool kernel test robot
2020-09-22  0:30 ` [PATCH] md/raid10: fix boolreturn.cocci warnings kernel test robot
2020-09-22  5:48   ` Xiao Ni

Linux-Raid Archives on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-raid/0 linux-raid/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-raid linux-raid/ https://lore.kernel.org/linux-raid \
		linux-raid@vger.kernel.org
	public-inbox-index linux-raid

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-raid


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git