MD: use is_power_of_2 macro
authorJonathan Brassow <jbrassow@redhat.com>
Wed, 8 Jun 2011 23:01:10 +0000 (18:01 -0500)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 01:42:36 +0000 (11:42 +1000)
Make use of is_power_of_2 macro.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c

index f0769b34d65608661cab5142f3c5aefcdd79991d..7fc028f9701e4b128b4e61ff2a3e97de18f94e10 100644 (file)
@@ -651,7 +651,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
                reason = "unrecognized superblock version";
        else if (chunksize < 512)
                reason = "bitmap chunksize too small";
-       else if ((1 << ffz(~chunksize)) != chunksize)
+       else if (!is_power_of_2(chunksize))
                reason = "bitmap chunksize not a power of 2";
        else if (daemon_sleep < 1 || daemon_sleep > MAX_SCHEDULE_TIMEOUT)
                reason = "daemon sleep period out of range";