diff mbox series

[for-next,1/3] btrfs: fix to return bool instead of int

Message ID 20210201085204.700090-2-naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series Fix potential deadlock, types and typo in zoned series | expand

Commit Message

Naohiro Aota Feb. 1, 2021, 8:52 a.m. UTC
The variable "changed" in dev_extent_hole_check_zoned() is using int
(0/1) to track if the hole is changed. Change it to bool to match the
definition of the function.

Fixes: 69e81c8e2824 ("btrfs: implement zoned chunk allocator")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 fs/btrfs/volumes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index fe2ed5f80804..102dc6636833 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1433,7 +1433,7 @@  static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 	u64 zone_size = device->zone_info->zone_size;
 	u64 pos;
 	int ret;
-	int changed = 0;
+	bool changed = false;
 
 	ASSERT(IS_ALIGNED(*hole_start, zone_size));
 
@@ -1444,7 +1444,7 @@  static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 		if (pos != *hole_start) {
 			*hole_size = *hole_start + *hole_size - pos;
 			*hole_start = pos;
-			changed = 1;
+			changed = true;
 			if (*hole_size < num_bytes)
 				break;
 		}
@@ -1459,12 +1459,12 @@  static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 		if (ret == -ERANGE) {
 			*hole_start += *hole_size;
 			*hole_size = 0;
-			return 1;
+			return true;
 		}
 
 		*hole_start += zone_size;
 		*hole_size -= zone_size;
-		changed = 1;
+		changed = true;
 	}
 
 	return changed;