net/qede/base: fix find zero bit macro
authorRasesh Mody <rasesh.mody@cavium.com>
Tue, 25 Apr 2017 07:28:45 +0000 (00:28 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Apr 2017 12:46:18 +0000 (14:46 +0200)
Use appropriate operator for if condition

Coverity issue: 1379399
Coverity issue: 1379404
Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/bcm_osal.c

index 28be958..3f895cd 100644 (file)
@@ -98,9 +98,7 @@ inline u32 qede_find_first_zero_bit(unsigned long *addr, u32 limit)
        u32 nwords = 0;
        OSAL_BUILD_BUG_ON(!limit);
        nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
-       for (i = 0; i < nwords; i++)
-               if (~(addr[i] != 0))
-                       break;
+       for (i = 0; i < nwords && ~(addr[i]) == 0; i++);
        return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffz(addr[i]);
 }