summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-06-18 00:46:10 +0200
committerNeilBrown <neilb@suse.de>2009-06-18 00:46:10 +0200
commit0ba459d26260d4d13346c76642f461b2bf607eef (patch)
tree39b4032b6f2e83caf35fe682fb190d7b8f029840
parentmd: convert conf->chunk_size and conf->prev_chunk to sectors. (diff)
downloadlinux-0ba459d26260d4d13346c76642f461b2bf607eef.tar.xz
linux-0ba459d26260d4d13346c76642f461b2bf607eef.zip
md/raid5: Use is_power_of_2() in raid5_reconfig()/raid6_reconfig().
Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/raid5.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index eaa2d3ee2b5d..72e8a324dcfb 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5167,8 +5167,7 @@ static int raid5_reconfig(mddev_t *mddev, int new_layout, int new_chunk)
if (new_layout >= 0 && !algorithm_valid_raid5(new_layout))
return -EINVAL;
if (new_chunk > 0) {
- if (new_chunk & (new_chunk-1))
- /* not a power of 2 */
+ if (!is_power_of_2(new_chunk))
return -EINVAL;
if (new_chunk < PAGE_SIZE)
return -EINVAL;
@@ -5206,8 +5205,7 @@ static int raid6_reconfig(mddev_t *mddev, int new_layout, int new_chunk)
if (new_layout >= 0 && !algorithm_valid_raid6(new_layout))
return -EINVAL;
if (new_chunk > 0) {
- if (new_chunk & (new_chunk-1))
- /* not a power of 2 */
+ if (!is_power_of_2(new_chunk))
return -EINVAL;
if (new_chunk < PAGE_SIZE)
return -EINVAL;