All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: forwarded message from Vignesh Babu BM
@ 2007-02-20  1:38 Neil Brown
  0 siblings, 0 replies; only message in thread
From: Neil Brown @ 2007-02-20  1:38 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 44 bytes --]


mis-directed patch for you....

NeilBrown


[-- Attachment #2: forwarded message --]
[-- Type: message/rfc822, Size: 4616 bytes --]

From: Vignesh Babu BM <vignesh.babu@wipro.com>
To: Kernel Janitors List <kernel-janitors@lists.osdl.org>
Cc: mingo@redhat.com, neilb@suse.de, linux-raid@vger.kernel.org
Subject: [KJ][PATCH] is_power_of_2 in md
Date: Fri, 16 Feb 2007 17:35:16 +0530
Message-ID: <1171627516.6127.2.camel@wriver-t81fb058.linuxcoe>



Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2


diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 0821a2b..f2d4b23 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
+#include <linux/log2.h>
 
 #include "dm-snap.h"
 #include "dm-bio-list.h"
@@ -414,7 +415,7 @@ static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg,
 	chunk_size = round_up(chunk_size, PAGE_SIZE >> 9);
 
 	/* Check chunk_size is a power of 2 */
-	if (chunk_size & (chunk_size - 1)) {
+	if (!is_power_of_2(chunk_size)) {
 		*error = "Chunk size is not a power of 2";
 		return -EINVAL;
 	}

-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-20  1:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20  1:38 forwarded message from Vignesh Babu BM Neil Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.