From: vignesh babu Date: Mon, 9 Jul 2007 18:50:22 +0000 (-0700) Subject: Use is_power_of_2() in myri10ge/myri10ge.c X-Git-Tag: MMI-PSA29.97-13-9~42340^2~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=199126a23a091585670fba023529b73047bb2bad;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Use is_power_of_2() in myri10ge/myri10ge.c Replace (n & (n-1)) with is_power_of_2() Signed-off-by: vignesh babu Cc: Brice Goglin Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- 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 #include #include +#include #include #include #include @@ -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 {