btrfs: assign proper values to a bool variable in dev_extent_hole_check_zoned
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Wed, 3 Mar 2021 09:45:28 +0000 (17:45 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:15 +0000 (17:25 +0200)
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>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 1c6810b..d4ca721 100644 (file)
@@ -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;