From: vignesh babu Date: Sat, 25 Aug 2007 05:27:55 +0000 (-0700) Subject: [NET]: is_power_of_2 in net/core/neighbour.c X-Git-Tag: v2.6.23-rc4~3^2~10 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c3609d510f844100669965db8a9ff10ba029bb4a;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David S. Miller --- diff --git a/net/core/neighbour.c b/net/core/neighbour.c index ca2a1533138..f7de8f24d8d 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -33,6 +33,7 @@ #include #include #include +#include #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;