]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/cxgb3/cxgb3_main.c
Merge branch 'for-2.6.23' into merge
[linux-2.6-omap-h63xx.git] / drivers / net / cxgb3 / cxgb3_main.c
index 15defe4c4f05e947f765b2e5b3ab17904bb2722b..6fd1e5241833d7e2f68800f092ade1074e27256a 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/proc_fs.h>
 #include <linux/rtnetlink.h>
 #include <linux/firmware.h>
+#include <linux/log2.h>
 #include <asm/uaccess.h>
 
 #include "common.h"
@@ -1818,8 +1819,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
                        return -EBUSY;
                if (copy_from_user(&m, useraddr, sizeof(m)))
                        return -EFAULT;
-               if (!m.rx_pg_sz || (m.rx_pg_sz & (m.rx_pg_sz - 1)) ||
-                       !m.tx_pg_sz || (m.tx_pg_sz & (m.tx_pg_sz - 1)))
+               if (!is_power_of_2(m.rx_pg_sz) ||
+                       !is_power_of_2(m.tx_pg_sz))
                        return -EINVAL; /* not power of 2 */
                if (!(m.rx_pg_sz & 0x14000))
                        return -EINVAL; /* not 16KB or 64KB */