From: Rasesh Mody Date: Tue, 25 Apr 2017 07:28:45 +0000 (-0700) Subject: net/qede/base: fix find zero bit macro X-Git-Tag: spdx-start~3346 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9a671097bc537cd830f6c9a68de68573ed5522f2;p=dpdk.git 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 --- 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]); }