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>,
	qiming.yang@intel.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Nir Efrati <nir.efrati@intel.com>
Subject: [PATCH v2 2/2] net/e1000: fix incorrect fallthrough in switch
Date: Thu, 14 Nov 2024 09:11:55 -0800	[thread overview]
Message-ID: <20241114171342.19767-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20241114171342.19767-1-stephen@networkplumber.org>

There is an incorrect fallthrough identified by PVS studio.
Even though this is in base code it should be fixed, and
the warning should be re-enabled to prevent future bugs.

Link: https://pvs-studio.com/en/blog/posts/cpp/1183/

Fixes: f2553cb9eba6 ("net/e1000/base: add new I219 devices")
Cc: qiming.yang@intel.com

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/e1000/base/e1000_82575.c | 2 +-
 drivers/net/e1000/base/e1000_api.c   | 2 +-
 drivers/net/e1000/base/meson.build   | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/base/e1000_82575.c b/drivers/net/e1000/base/e1000_82575.c
index 7c78649393..ccc7aeab21 100644
--- a/drivers/net/e1000/base/e1000_82575.c
+++ b/drivers/net/e1000/base/e1000_82575.c
@@ -1722,6 +1722,7 @@ STATIC s32 e1000_get_media_type_82575(struct e1000_hw *hw)
 			break;
 		}
 		/* Fall through for I2C based SGMII */
+		/* Fall through */
 	case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
 		/* read media type from SFP EEPROM */
 		ret_val = e1000_set_sfp_media_type_82575(hw);
@@ -3585,4 +3586,3 @@ void e1000_i2c_bus_clear(struct e1000_hw *hw)
 	/* Put the i2c bus back to default state */
 	e1000_i2c_stop(hw);
 }
-
diff --git a/drivers/net/e1000/base/e1000_api.c b/drivers/net/e1000/base/e1000_api.c
index 0f6e5afa3b..61b3ead469 100644
--- a/drivers/net/e1000/base/e1000_api.c
+++ b/drivers/net/e1000/base/e1000_api.c
@@ -295,6 +295,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_RPL_I219_LM23:
 	case E1000_DEV_ID_PCH_RPL_I219_V23:
 		mac->type = e1000_pch_tgp;
+		break;
 	case E1000_DEV_ID_PCH_ADL_I219_LM17:
 	case E1000_DEV_ID_PCH_ADL_I219_V17:
 	case E1000_DEV_ID_PCH_RPL_I219_LM22:
@@ -1368,4 +1369,3 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
 	if (hw->mac.ops.shutdown_serdes)
 		hw->mac.ops.shutdown_serdes(hw);
 }
-
diff --git a/drivers/net/e1000/base/meson.build b/drivers/net/e1000/base/meson.build
index 6d6048488f..e73f3d6d55 100644
--- a/drivers/net/e1000/base/meson.build
+++ b/drivers/net/e1000/base/meson.build
@@ -24,7 +24,6 @@ sources = [
 
 error_cflags = [
         '-Wno-unused-parameter',
-        '-Wno-implicit-fallthrough',
 ]
 c_args = cflags
 foreach flag: error_cflags
-- 
2.45.2


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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14  0:36 [PATCH 0/2] fallthrough related handling Stephen Hemminger
2024-11-14  0:36 ` [PATCH 1/2] net/e1000: fix incorrect fallthrough in switch Stephen Hemminger
2024-11-14  9:03   ` Bruce Richardson
2024-11-14  0:36 ` [PATCH 2/2] common/dpaax: do not disable fallthrough warnings Stephen Hemminger
2024-11-14  6:06   ` Hemant Agrawal
2024-11-14 17:11 ` [PATCH v2 0/2] re-enable implicit fallthrough checks Stephen Hemminger
2024-11-14 17:11   ` [PATCH v2 1/2] common/dpaax: do not disable fallthrough warnings Stephen Hemminger
2024-11-14 17:11   ` 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=20241114171342.19767-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=nir.efrati@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    /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).