DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Julien Aube <julien_dpdk@jaube.fr>,
	Harish Patil <harish.patil@cavium.com>
Subject: [PATCH 4/4] net/bnx2x: fix duplicate branch
Date: Tue, 12 Nov 2024 09:43:56 -0800	[thread overview]
Message-ID: <20241112174613.326565-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20241112174613.326565-1-stephen@networkplumber.org>

Coverity spotted that both legs of the conditional are the same.
Looking at kernel driver there is additional code there, but the
kernel driver supports Wake On Lan, and DPDK does not.

Coverity issue: 362072
Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index d96fcb55c9..51e5cabf7b 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -1623,16 +1623,12 @@ static int bnx2x_nic_unload_no_mcp(struct bnx2x_softc *sc)
 }
 
 /* request unload mode from the MCP: COMMON, PORT or FUNCTION */
-static uint32_t bnx2x_send_unload_req(struct bnx2x_softc *sc, int unload_mode)
+static uint32_t bnx2x_send_unload_req(struct bnx2x_softc *sc, int unload_mode __rte_unused)
 {
 	uint32_t reset_code = 0;
 
 	/* Select the UNLOAD request mode */
-	if (unload_mode == UNLOAD_NORMAL) {
-		reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
-	} else {
-		reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
-	}
+	reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
 
 	/* Send the request to the MCP */
 	if (!BNX2X_NOMCP(sc)) {
-- 
2.45.2


      parent reply	other threads:[~2024-11-12 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 17:43 [PATCH 0/4] Coverity buf fixes for bnx2x Stephen Hemminger
2024-11-12 17:43 ` [PATCH 1/4] net/bnx2x: remove dead conditional Stephen Hemminger
2024-11-12 17:43 ` [PATCH 2/4] net/bnx2x: fix always true expression Stephen Hemminger
2024-11-12 17:43 ` [PATCH 3/4] net/bnx2x: fix possible infinite loop at startup Stephen Hemminger
2024-11-12 17:43 ` Stephen Hemminger [this message]

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=20241112174613.326565-5-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=harish.patil@cavium.com \
    --cc=julien_dpdk@jaube.fr \
    /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).