浏览代码

MD: use is_power_of_2 macro

Make use of is_power_of_2 macro.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Jonathan Brassow 14 年之前
父节点
当前提交
d744540cd3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/md/bitmap.c

+ 1 - 1
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";