Commit 199126a2 authored by vignesh babu's avatar vignesh babu Committed by Jeff Garzik

Use is_power_of_2() in myri10ge/myri10ge.c

Replace (n & (n-1)) with is_power_of_2()
Signed-off-by: default avatarvignesh babu <vignesh.babu@wipro.com>
Cc: Brice Goglin <brice@myri.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d9da466a
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/log2.h>
#include <net/checksum.h> #include <net/checksum.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -1804,7 +1805,7 @@ static int myri10ge_open(struct net_device *dev) ...@@ -1804,7 +1805,7 @@ static int myri10ge_open(struct net_device *dev)
*/ */
big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD;
if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) { if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) {
while ((big_pow2 & (big_pow2 - 1)) != 0) while (!is_power_of_2(big_pow2))
big_pow2++; big_pow2++;
mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD; mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment