wifi: mac80211: Fix -Wc23-extensions in hwmp_route_info_get()

When building with a version of clang that supports
'-fms-anonymous-structs' (which will be used by the kernel instead of
the wider '-fms-extensions'), there are a couple warnings after some
recent mesg_hwmp.c changes:

  net/mac80211/mesh_hwmp.c:373:3: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions]
    373 |                 struct ieee80211_mesh_hwmp_preq_top *preq_elem_top =
        |                 ^
  net/mac80211/mesh_hwmp.c:390:3: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions]
    390 |                 struct ieee80211_mesh_hwmp_prep_top *prep_elem_top =
        |                 ^
  2 errors generated.

Enclose the switch case blocks in braces to clear up the warning.

Fixes: a91c65cb99 ("wifi: mac80211: Use struct instead of macro for PREP frame")
Fixes: 4ac20bd40b ("wifi: mac80211: Use struct instead of macro for PREQ frame")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260604-mac80211-mesh_hwmp-fix-c23-extensions-v1-1-25a64d6ce541@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Nathan Chancellor
2026-06-05 09:55:08 +02:00
committed by Johannes Berg
parent a26c2a22e7
commit c52b144225
+4 -2
View File
@@ -369,7 +369,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
fresh_info = true;
switch (action) {
case MPATH_PREQ:
case MPATH_PREQ: {
struct ieee80211_mesh_hwmp_preq_top *preq_elem_top =
(void *)hwmp_ie;
struct ieee80211_mesh_hwmp_preq_bottom *preq_elem_bottom =
@@ -381,7 +381,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
orig_metric = le32_to_cpu(preq_elem_bottom->metric);
hopcount = preq_elem_top->hopcount + 1;
break;
case MPATH_PREP:
}
case MPATH_PREP: {
/* Originator here refers to the MP that was the target in the
* Path Request. We divert from the nomenclature in the draft
* so that we can easily use a single function to gather path
@@ -398,6 +399,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
orig_metric = le32_to_cpu(prep_elem_bottom->metric);
hopcount = prep_elem_top->hopcount + 1;
break;
}
default:
rcu_read_unlock();
return 0;