From 9a671097bc537cd830f6c9a68de68573ed5522f2 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Tue, 25 Apr 2017 00:28:45 -0700 Subject: [PATCH] net/qede/base: fix find zero bit macro 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 --- drivers/net/qede/base/bcm_osal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c index 28be9587a6..3f895cd46e 100644 --- a/drivers/net/qede/base/bcm_osal.c +++ b/drivers/net/qede/base/bcm_osal.c @@ -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]); } -- 2.20.1