From: vignesh babu Date: Mon, 16 Jul 2007 06:41:34 +0000 (-0700) Subject: is_power_of_2: kernel/kfifo.c X-Git-Tag: v2.6.23-rc1~827 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f84d5a76c50d9752cdec64a6e536ee3901b267f6;p=linux-2.6-omap-h63xx.git is_power_of_2: kernel/kfifo.c Replace (n & (n-1)) with is_power_of_2() Signed-off-by: vignesh babu Acked-by: Stelian Pop Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kfifo.c b/kernel/kfifo.c index cee419143fd..bc41ad0f24f 100644 --- a/kernel/kfifo.c +++ b/kernel/kfifo.c @@ -24,6 +24,7 @@ #include #include #include +#include /** * kfifo_init - allocates a new FIFO using a preallocated buffer @@ -41,7 +42,7 @@ struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, 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)