From: Andre Noll <maan@systemlinux.org>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, Andre Noll <maan@systemlinux.org>
Subject: [PATCH 5/6] md/raid5: Use is_power_of_2() in raid5_reconfig()/raid6_reconfig().
Date: Mon, 25 May 2009 11:27:36 +0200 [thread overview]
Message-ID: <1243243657-21855-6-git-send-email-maan@systemlinux.org> (raw)
In-Reply-To: <1243243657-21855-1-git-send-email-maan@systemlinux.org>
Signed-off-by: Andre Noll <maan@systemlinux.org>
---
drivers/md/raid5.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e7952f0..772593d 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;
--
1.5.4.3
next prev parent reply other threads:[~2009-05-25 9:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 9:27 [PATCH 0/6] md: More sector_t conversions -- intro Andre Noll
2009-05-25 9:27 ` [PATCH 1/6] md: Make mddev->chunk_size sector-based Andre Noll
2009-05-25 23:02 ` Neil Brown
2009-05-25 9:27 ` [PATCH 2/6] md: Fix a bug in super_1_sync() Andre Noll
2009-05-25 9:49 ` NeilBrown
2009-05-25 13:40 ` Andre Noll
2009-05-25 9:27 ` [PATCH 3/6] md: Convert mddev->new_chunk to sectors Andre Noll
2009-05-25 9:27 ` [PATCH 4/6] md: convert conf->chunk_size and conf->prev_chunk " Andre Noll
2009-05-25 23:14 ` Neil Brown
2009-05-25 9:27 ` Andre Noll [this message]
2009-05-25 9:27 ` [PATCH 6/6] md/raid5: Kill outdated comment Andre Noll
2009-05-25 23:49 ` [PATCH 0/6] md: More sector_t conversions -- intro Neil Brown
2009-05-26 2:40 ` Neil Brown
2009-05-27 8:02 ` Andre Noll
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243243657-21855-6-git-send-email-maan@systemlinux.org \
--to=maan@systemlinux.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).