From: Jonathan Brassow Date: Wed, 8 Jun 2011 23:01:10 +0000 (-0500) Subject: MD: use is_power_of_2 macro X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d744540cd39e93976c4c8401e140232444ef3b0b;p=openwrt%2Fstaging%2Fblogic.git MD: use is_power_of_2 macro Make use of is_power_of_2 macro. Signed-off-by: Jonathan Brassow Signed-off-by: NeilBrown --- diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index f0769b34d656..7fc028f9701e 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -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";