From: Gal Pressman <gal@nvidia.com>
To: Michal Kubecek <mkubecek@suse.cz>,
Chintan Vankar <c-vankar@ti.com>, <netdev@vger.kernel.org>
Cc: Gal Pressman <gal@nvidia.com>, Carolina Jubran <cjubran@nvidia.com>
Subject: [PATCH ethtool] ethtool: Fix declaration after label compilation error
Date: Wed, 31 Dec 2025 13:25:33 +0200 [thread overview]
Message-ID: <20251231112533.303145-1-gal@nvidia.com> (raw)
Wrap case blocks in braces to allow variable declarations after case
labels, fixing C89 compilation errors:
am65-cpsw-nuss.c: In function 'cpsw_dump_ale':
am65-cpsw-nuss.c:423:4: error: a label can only be part of a statement and a declaration is not a statement
u32 oui_entry = cpsw_ale_get_oui_addr(ale_pos);
^~~
am65-cpsw-nuss.c:432:4: error: a label can only be part of a statement and a declaration is not a statement
u32 vlan_entry_type = cpsw_ale_get_vlan_entry_type(ale_pos);
^~~
Fixes: eb91e05c98d4 ("pretty: Add support for TI K3 CPSW registers and ALE table dump")
Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
am65-cpsw-nuss.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/am65-cpsw-nuss.c b/am65-cpsw-nuss.c
index de8e3e9d4cc1..fbb20bf271e7 100644
--- a/am65-cpsw-nuss.c
+++ b/am65-cpsw-nuss.c
@@ -419,7 +419,7 @@ void cpsw_dump_ale(struct k3_cpsw_regdump_hdr *ale_hdr, u32 *ale_pos)
case ALE_ENTRY_FREE:
break;
- case ALE_ENTRY_ADDR:
+ case ALE_ENTRY_ADDR: {
u32 oui_entry = cpsw_ale_get_oui_addr(ale_pos);
if (oui_entry == 0x2)
@@ -427,8 +427,9 @@ void cpsw_dump_ale(struct k3_cpsw_regdump_hdr *ale_hdr, u32 *ale_pos)
else
cpsw_ale_dump_addr(i, ale_pos);
break;
+ }
- case ALE_ENTRY_VLAN:
+ case ALE_ENTRY_VLAN: {
u32 vlan_entry_type = cpsw_ale_get_vlan_entry_type(ale_pos);
if (vlan_entry_type == VLAN_INNER_ENTRY)
@@ -442,6 +443,7 @@ void cpsw_dump_ale(struct k3_cpsw_regdump_hdr *ale_hdr, u32 *ale_pos)
else if (vlan_entry_type & VLAN_IPV6_ENTRY_MASK)
cpsw_ale_dump_ipv6_entry(i, ale_pos);
break;
+ }
case ALE_ENTRY_VLAN_ADDR:
cpsw_ale_dump_vlan_addr(i, ale_pos);
--
2.40.1
next reply other threads:[~2025-12-31 11:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-31 11:25 Gal Pressman [this message]
2026-01-05 17:50 ` [PATCH ethtool] ethtool: Fix declaration after label compilation error patchwork-bot+netdevbpf
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=20251231112533.303145-1-gal@nvidia.com \
--to=gal@nvidia.com \
--cc=c-vankar@ti.com \
--cc=cjubran@nvidia.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.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).