Use is_power_of_2() in myri10ge/myri10ge.c
authorvignesh babu <vignesh.babu@wipro.com>
Mon, 9 Jul 2007 18:50:22 +0000 (11:50 -0700)
committerJeff Garzik <jeff@garzik.org>
Tue, 10 Jul 2007 16:22:30 +0000 (12:22 -0400)
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>
drivers/net/myri10ge/myri10ge.c

index d0cc122fa3f0f0710eb610f7d23cbdbd7527469a..e1732c164a4092e925bcf4235b540c60e7ecb92e 100644 (file)
@@ -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 {