netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool] ethtool: Fix declaration after label compilation error
@ 2025-12-31 11:25 Gal Pressman
  0 siblings, 0 replies; only message in thread
From: Gal Pressman @ 2025-12-31 11:25 UTC (permalink / raw)
  To: Michal Kubecek, Chintan Vankar, netdev; +Cc: Gal Pressman, Carolina Jubran

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-31 11:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-31 11:25 [PATCH ethtool] ethtool: Fix declaration after label compilation error Gal Pressman

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).