Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f84d5a76c50d9752cdec64a6e536ee3901b267f6
Commit:     f84d5a76c50d9752cdec64a6e536ee3901b267f6
Parent:     cf99abace7e07dd8491e7093a9a9ef11d48838ed
Author:     vignesh babu <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 15 23:41:34 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 09:05:50 2007 -0700

    is_power_of_2: kernel/kfifo.c
    
    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 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index cee4191..bc41ad0 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to