diff options
author | vignesh babu <vignesh.babu@wipro.com> | 2007-07-09 20:50:22 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-10 18:22:30 +0200 |
commit | 199126a23a091585670fba023529b73047bb2bad (patch) | |
tree | 9562967850cdf195b469023a5d0d929e530055e9 | |
parent | use is_power_of_2() in cxgb3/cxgb3_main.c (diff) | |
download | linux-199126a23a091585670fba023529b73047bb2bad.tar.xz linux-199126a23a091585670fba023529b73047bb2bad.zip |
Use is_power_of_2() in myri10ge/myri10ge.c
Replace (n & (n-1)) with is_power_of_2()
Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Cc: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index d0cc122fa3f0..e1732c164a40 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -60,6 +60,7 @@ #include <linux/crc32.h> #include <linux/moduleparam.h> #include <linux/io.h> +#include <linux/log2.h> #include <net/checksum.h> #include <asm/byteorder.h> #include <asm/io.h> @@ -1804,7 +1805,7 @@ static int myri10ge_open(struct net_device *dev) */ big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) { - while ((big_pow2 & (big_pow2 - 1)) != 0) + while (!is_power_of_2(big_pow2)) big_pow2++; mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; } else { |