Skip to contentSkip to conversation

arm_mpam: Fix the build error in resctrl_arch_is_evt_configurable()

PATCH New Shanker Donthineni 1 participant 1 message Oct 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm_mpam: Fix the build error in resctrl_arch_is_evt_configurable()

Move the declaration of the variable 'cprops' outside of the switch statement in order to resolve the build error.

mpam_resctrl.c: In function ‘resctrl_arch_is_evt_configurable’:
mpam_resctrl.c:745:3: error: a label can only be part of a statement and a declaration is not a statement

  745 |   struct mpam_props *cprops;
      |   ^~~~~~
---
 drivers/platform/mpam/mpam_resctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/mpam/mpam_resctrl.c +2 -1
index 6e9925fcf934..1a691535d23d 100644
@@ -740,9 +740,10 @@ static void mpam_resctrl_pick_mba(void)
 
 bool resctrl_arch_is_evt_configurable(enum resctrl_event_id evt)
 {
+	struct mpam_props *cprops;
+
 	switch (evt) {
         case QOS_L3_MBM_LOCAL_EVENT_ID:
-		struct mpam_props *cprops;
 
 		if (!mbm_local_class)
 			return false;
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel