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 <redacted>
Signed-off-by: Gal Pressman <redacted>
---
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