Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3609d510f844100669965db8a9ff10ba029bb4a
Commit:     c3609d510f844100669965db8a9ff10ba029bb4a
Parent:     26722873a460703e319462afa7ebb8ed3a036c07
Author:     vignesh babu <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 24 22:27:55 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sun Aug 26 18:35:37 2007 -0700

    [NET]: is_power_of_2 in net/core/neighbour.c
    
    Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
    
    Signed-off-by: vignesh babu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/neighbour.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ca2a153..f7de8f2 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -33,6 +33,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/random.h>
 #include <linux/string.h>
+#include <linux/log2.h>
 
 #define NEIGH_DEBUG 1
 
@@ -311,7 +312,7 @@ static void neigh_hash_grow(struct neigh_table *tbl, 
unsigned long new_entries)
 
        NEIGH_CACHE_STAT_INC(tbl, hash_grows);
 
-       BUG_ON(new_entries & (new_entries - 1));
+       BUG_ON(!is_power_of_2(new_entries));
        new_hash = neigh_hash_alloc(new_entries);
        if (!new_hash)
                return;
-
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