diff options
author | vignesh babu <vignesh.babu@wipro.com> | 2007-07-09 14:50:22 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-10 12:22:30 -0400 |
commit | 199126a23a091585670fba023529b73047bb2bad (patch) | |
tree | 9562967850cdf195b469023a5d0d929e530055e9 /drivers/net/myri10ge/myri10ge.c | |
parent | d9da466a3ce2ac005e05bb649a0f2cfb5c3d5d45 (diff) |
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>
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-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 @@ | |||
60 | #include <linux/crc32.h> | 60 | #include <linux/crc32.h> |
61 | #include <linux/moduleparam.h> | 61 | #include <linux/moduleparam.h> |
62 | #include <linux/io.h> | 62 | #include <linux/io.h> |
63 | #include <linux/log2.h> | ||
63 | #include <net/checksum.h> | 64 | #include <net/checksum.h> |
64 | #include <asm/byteorder.h> | 65 | #include <asm/byteorder.h> |
65 | #include <asm/io.h> | 66 | #include <asm/io.h> |
@@ -1804,7 +1805,7 @@ static int myri10ge_open(struct net_device *dev) | |||
1804 | */ | 1805 | */ |
1805 | big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; | 1806 | big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; |
1806 | if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) { | 1807 | if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) { |
1807 | while ((big_pow2 & (big_pow2 - 1)) != 0) | 1808 | while (!is_power_of_2(big_pow2)) |
1808 | big_pow2++; | 1809 | big_pow2++; |
1809 | mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; | 1810 | mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; |
1810 | } else { | 1811 | } else { |