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

Shanker Donthineni sdonthineni at nvidia.com
Thu Oct 26 07:27:16 PDT 2023


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;
      |   ^~~~~~

Signed-off-by: Shanker Donthineni <sdonthineni at nvidia.com>
---
 drivers/platform/mpam/mpam_resctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c
index 6e9925fcf934..1a691535d23d 100644
--- a/drivers/platform/mpam/mpam_resctrl.c
+++ b/drivers/platform/mpam/mpam_resctrl.c
@@ -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;
-- 
2.25.1




More information about the linux-arm-kernel mailing list