diff options
author | David Sterba <dsterba@suse.com> | 2022-10-31 20:33:42 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:51 +0100 |
commit | fd463ac4616e69c7306c680dabfe857a2f50fc69 (patch) | |
tree | b016d60009e47380557c0fb1cc5d83eef5279126 /fs | |
parent | btrfs: zlib: use copy_page for full page copy (diff) | |
download | linux-fd463ac4616e69c7306c680dabfe857a2f50fc69.tar.xz linux-fd463ac4616e69c7306c680dabfe857a2f50fc69.zip |
btrfs: zoned: use helper to check a power of two zone size
We have a 64bit compatible helper to check if a value is a power of two,
use it instead of open coding it.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/zoned.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 13034c3bbb65..95dec93374ea 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -394,8 +394,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache) zone_sectors = bdev_zone_sectors(bdev); } - /* Check if it's power of 2 (see is_power_of_2) */ - ASSERT(zone_sectors != 0 && (zone_sectors & (zone_sectors - 1)) == 0); + ASSERT(is_power_of_two_u64(zone_sectors)); zone_info->zone_size = zone_sectors << SECTOR_SHIFT; /* We reject devices with a zone size larger than 8GB */ |