is_power_of_2-decnet/dn_route.c
Subsystems (2)
PATCH 1/1 is_power_of_2-decnet/dn_route.c
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2
Signed-off-by vignesh babu <[email protected]>
---
net/decnet/dn_route.c +2 -1
@@ -76,6 +76,7 @@#include <linux/netfilter_decnet.h> #include <linux/rcupdate.h> #include <linux/times.h> +#include <linux/log2.h> #include <asm/errno.h> #include <net/netlink.h> #include <net/neighbour.h>
@@ -1792,7 +1793,7 @@ void __init dn_route_init(void) do { dn_rt_hash_mask = (1UL << order) * PAGE_SIZE / sizeof(struct dn_rt_hash_bucket); - while(dn_rt_hash_mask & (dn_rt_hash_mask - 1)) + while(!is_power_of_2(dn_rt_hash_mask)) dn_rt_hash_mask--; dn_rt_hash_table = (struct dn_rt_hash_bucket *) __get_free_pages(GFP_ATOMIC, order);
Signature · 8 lines
Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors