[PATCH v2 1/3] firmware: arm_scmi: Add debug decrement counter
Philip Radford
philip.radford at arm.com
Mon Jun 30 03:55:41 PDT 2025
Create scmi_dec_count function to decrease any of the Arm SCMI
debug counters. There is already an scmi_inc_count function
but no decrement function.
Reviewed-by: Cristian Marussi <cristian.marussi at arm.com>
Signed-off-by: Philip Radford <philip.radford at arm.com>
---
V1->V2
- Amended commit message
---
drivers/firmware/arm_scmi/common.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index dab758c5fdea..c6495c4a0e8a 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -314,6 +314,12 @@ static inline void scmi_inc_count(atomic_t *arr, int stat)
atomic_inc(&arr[stat]);
}
+static inline void scmi_dec_count(atomic_t *arr, int stat)
+{
+ if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS))
+ atomic_dec(&arr[stat]);
+}
+
enum scmi_bad_msg {
MSG_UNEXPECTED = -1,
MSG_INVALID = -2,
--
2.25.1
More information about the linux-arm-kernel
mailing list