mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Use is_power_of_2() in myri10ge/myri10ge.c
Replace (n & (n-1)) with is_power_of_2() Signed-off-by: vignesh babu <[email protected]> Cc: Brice Goglin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
This commit is contained in:
parent
d9da466a3c
commit
199126a23a
1 changed files with 2 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue