diff mbox series

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

Message ID 20231026142716.2670533-1-sdonthineni@nvidia.com (mailing list archive)
State New, archived
Headers show
Series [1/1] arm_mpam: Fix the build error in resctrl_arch_is_evt_configurable() | expand

Commit Message

Shanker Donthineni Oct. 26, 2023, 2:27 p.m. UTC
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@nvidia.com>
---
 drivers/platform/mpam/mpam_resctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;