* [KJ] [PATCH]is_power_of_2-decnet/dn_route.c
@ 2007-06-14 10:46 vignesh babu
0 siblings, 0 replies; only message in thread
From: vignesh babu @ 2007-06-14 10:46 UTC (permalink / raw)
To: kernel-janitors
Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2
Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
---
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index a8bf106..0a67706 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -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);
--
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-14 10:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14 10:46 [KJ] [PATCH]is_power_of_2-decnet/dn_route.c vignesh babu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.