projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf99aba
)
is_power_of_2: kernel/kfifo.c
author
vignesh babu
<
[email protected]
>
Mon, 16 Jul 2007 06:41:34 +0000
(23:41 -0700)
committer
Linus Torvalds
<
[email protected]
>
Mon, 16 Jul 2007 16:05:50 +0000
(09:05 -0700)
Replace (n & (n-1)) with is_power_of_2()
Signed-off-by: vignesh babu <
[email protected]
>
Acked-by: Stelian Pop <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/kfifo.c
patch
|
blob
|
history
diff --git
a/kernel/kfifo.c
b/kernel/kfifo.c
index cee419143fd47bb410b0cf80e7762a0f02ffbfce..bc41ad0f24f881845d96d77a00a3d3535968566b 100644
(file)
--- 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)