is_power_of_2 in net/core/neighbour.c
Subsystems (3)
Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
Signed-off-by vignesh babu <[email protected]>
---
net/core/neighbour.c +2 -1
@@ -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 ;
Signature · 3 lines
Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?"
David Miller
maintainerFrom: vignesh babu <[email protected]>
Date: Mon, 13 Aug 2007 18:33:47 +0530
Quoted 3 lines
Replacing n & (n - 1) for power of 2 check by
is_power_of_2(n)Signed-off-by vignesh babu <[email protected]>
Patch applied, thanks.
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with
"subscribe kernel-janitors" in message body and follow instructions.
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors