aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kfifo.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-23 10:20:10 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-23 10:20:10 +0100
commit39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch)
tree7a02a317b9ad57da51ca99887c119e779ccf3f13 /kernel/kfifo.c
parent[JFFS2] Add declaration of jffs2_lzo_{init,exit} to compr.h (diff)
parentLinux 2.6.23-rc1 (diff)
downloadlinux-dev-39fe5434cb9de5da40510028b17b96bc4eb312b3.tar.xz
linux-dev-39fe5434cb9de5da40510028b17b96bc4eb312b3.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/kfifo.c')
-rw-r--r--kernel/kfifo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index cee419143fd4..bc41ad0f24f8 100644
--- a/kernel/kfifo.c
+++ b/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 *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)