All of lore.kernel.org
 help / color / mirror / Atom feed
* + is_power_of_2-kernel-kfifoc.patch added to -mm tree
@ 2007-06-26 21:08 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-06-26 21:08 UTC (permalink / raw)
  To: mm-commits; +Cc: vignesh.babu, stelian


The patch titled
     is_power_of_2: kernel/kfifo.c
has been added to the -mm tree.  Its filename is
     is_power_of_2-kernel-kfifoc.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: is_power_of_2: kernel/kfifo.c
From: vignesh babu <vignesh.babu@wipro.com>

Replace (n & (n-1)) with is_power_of_2()

Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Acked-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/kfifo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN kernel/kfifo.c~is_power_of_2-kernel-kfifoc kernel/kfifo.c
--- a/kernel/kfifo.c~is_power_of_2-kernel-kfifoc
+++ a/kernel/kfifo.c
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/kfifo.h>
+#include <linux/log2.h>
 
 /**
  * kfifo_init - allocates a new FIFO using a preallocated buffer
@@ -41,7 +42,7 @@ struct kfifo *kfifo_init(unsigned char *
 	struct kfifo *fifo;
 
 	/* size must be a power of 2 */
-	BUG_ON(size & (size - 1));
+	BUG_ON(!is_power_of_2(size));
 
 	fifo = kmalloc(sizeof(struct kfifo), gfp_mask);
 	if (!fifo)
_

Patches currently in -mm which might be from vignesh.babu@wipro.com are

git-ubi.patch
use-is_power_of_2-in-cxgb3-cxgb3_mainc.patch
use-is_power_of_2-in-myri10ge-myri10gec.patch
is_power_of_2-ext3-superc.patch
is_power_of_2-jbd.patch
is_power_of_2-kernel-kfifoc.patch
is_power_of_2-ext4-superc.patch

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

only message in thread, other threads:[~2007-06-26 21:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26 21:08 + is_power_of_2-kernel-kfifoc.patch added to -mm tree akpm

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.