[PATCH v1 09/11] arm_mpam: resctrl: Make read_mon_cdp_safe() self consistent
From: Ben Horgan
Date: Fri Jul 10 2026 - 08:01:27 EST
When read_mon_cdp_safe() is called with cdp_enabled equal to false then the
reading returned in val is the sum of the monitor values for the given
component. However, when cdp_enabled equal to true it is again the sum of
the monitor values but with the initial value of val also added.
Change the cdp_enabled equals true case to match the false case. All
callers zero the val before calling and so no functional change is
anticipated.
Signed-off-by: Ben Horgan <ben.horgan@xxxxxxx>
---
drivers/resctrl/mpam_resctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
index 59dea750ff56..d97565479014 100644
--- a/drivers/resctrl/mpam_resctrl.c
+++ b/drivers/resctrl/mpam_resctrl.c
@@ -487,7 +487,7 @@ static int read_mon_cdp_safe(struct mpam_resctrl_mon *mon, struct mpam_component
if (err)
return err;
- *val += code_val + data_val;
+ *val = code_val + data_val;
return 0;
}
--
2.43.0