[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 <vignesh.babu@wipro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

vignesh babu and committed by
David S. Miller
c3609d51 26722873

+2 -1
+2 -1
net/core/neighbour.c
··· 33 33 #include <linux/rtnetlink.h> 34 34 #include <linux/random.h> 35 35 #include <linux/string.h> 36 + #include <linux/log2.h> 36 37 37 38 #define NEIGH_DEBUG 1 38 39 ··· 312 311 313 312 NEIGH_CACHE_STAT_INC(tbl, hash_grows); 314 313 315 - BUG_ON(new_entries & (new_entries - 1)); 314 + BUG_ON(!is_power_of_2(new_entries)); 316 315 new_hash = neigh_hash_alloc(new_entries); 317 316 if (!new_hash) 318 317 return;