* [PATCH] btrfs: Assign boolean values to a bool variable
@ 2021-03-03 9:45 Jiapeng Chong
2021-03-04 13:38 ` David Sterba
2021-05-10 9:37 ` Johannes Thumshirn
0 siblings, 2 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-03-03 9:45 UTC (permalink / raw)
To: clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel, Jiapeng Chong
Fix the following coccicheck warnings:
./fs/btrfs/volumes.c:1462:10-11: WARNING: return of 0/1 in function
'dev_extent_hole_check_zoned' with return type bool.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index bc3b33e..995920f 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1458,8 +1458,8 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
/* Given hole range was invalid (outside of device) */
if (ret == -ERANGE) {
*hole_start += *hole_size;
- *hole_size = 0;
- return 1;
+ *hole_size = false;
+ return true;
}
*hole_start += zone_size;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: Assign boolean values to a bool variable
2021-03-03 9:45 [PATCH] btrfs: Assign boolean values to a bool variable Jiapeng Chong
@ 2021-03-04 13:38 ` David Sterba
2021-05-10 9:37 ` Johannes Thumshirn
1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2021-03-04 13:38 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel
On Wed, Mar 03, 2021 at 05:45:28PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
>
> ./fs/btrfs/volumes.c:1462:10-11: WARNING: return of 0/1 in function
> 'dev_extent_hole_check_zoned' with return type bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: Assign boolean values to a bool variable
2021-03-03 9:45 [PATCH] btrfs: Assign boolean values to a bool variable Jiapeng Chong
2021-03-04 13:38 ` David Sterba
@ 2021-05-10 9:37 ` Johannes Thumshirn
2021-05-10 13:38 ` David Sterba
1 sibling, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2021-05-10 9:37 UTC (permalink / raw)
To: Jiapeng Chong, clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel
On 04/03/2021 02:51, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
>
> ./fs/btrfs/volumes.c:1462:10-11: WARNING: return of 0/1 in function
> 'dev_extent_hole_check_zoned' with return type bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> fs/btrfs/volumes.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index bc3b33e..995920f 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -1458,8 +1458,8 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
> /* Given hole range was invalid (outside of device) */
> if (ret == -ERANGE) {
> *hole_start += *hole_size;
> - *hole_size = 0;
> - return 1;
> + *hole_size = false;
Erm, hole_size is u64 and not bool
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: Assign boolean values to a bool variable
2021-05-10 9:37 ` Johannes Thumshirn
@ 2021-05-10 13:38 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2021-05-10 13:38 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: Jiapeng Chong, clm, josef, dsterba, linux-btrfs, linux-kernel
On Mon, May 10, 2021 at 09:37:58AM +0000, Johannes Thumshirn wrote:
> On 04/03/2021 02:51, Jiapeng Chong wrote:
> > Fix the following coccicheck warnings:
> >
> > ./fs/btrfs/volumes.c:1462:10-11: WARNING: return of 0/1 in function
> > 'dev_extent_hole_check_zoned' with return type bool.
> >
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > ---
> > fs/btrfs/volumes.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> > index bc3b33e..995920f 100644
> > --- a/fs/btrfs/volumes.c
> > +++ b/fs/btrfs/volumes.c
> > @@ -1458,8 +1458,8 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
> > /* Given hole range was invalid (outside of device) */
> > if (ret == -ERANGE) {
> > *hole_start += *hole_size;
> > - *hole_size = 0;
> > - return 1;
> > + *hole_size = false;
>
>
> Erm, hole_size is u64 and not bool
Thanks for catching it, I should have spotted that.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-10 13:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 9:45 [PATCH] btrfs: Assign boolean values to a bool variable Jiapeng Chong
2021-03-04 13:38 ` David Sterba
2021-05-10 9:37 ` Johannes Thumshirn
2021-05-10 13:38 ` David Sterba
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).