patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: <dev@dpdk.org>
Cc: Rasesh Mody <rasesh.mody@cavium.com>,
	<Dept-EngDPDKDev@cavium.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH 10/11] net/qede/base: fix find zero bit macro
Date: Tue, 25 Apr 2017 00:28:45 -0700	[thread overview]
Message-ID: <1493105326-31984-10-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1493105326-31984-1-git-send-email-rasesh.mody@cavium.com>

Use appropriate operater 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 |    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 28be958..3f895cd 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]);
 }
 
-- 
1.7.10.3

  parent reply	other threads:[~2017-04-25  7:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 07/11] net/qede: fix FW version string display for SRIOV Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 08/11] net/qede/base: fix coverity issues Rasesh Mody
2017-04-25  7:28 ` Rasesh Mody [this message]
2017-04-25  7:28 ` [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
2017-05-02  6:15   ` Yuanhan Liu
2017-05-04  0:14     ` Mody, Rasesh
2017-05-04  2:11       ` Yuanhan Liu
2017-05-07  5:15         ` Mody, Rasesh
2017-04-26  8:15 ` [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493105326-31984-10-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).