@@ -94,8 +94,6 @@
#include "common.h"
#include "notify.h"
-#define SCMI_MAX_PROTO 256
-
#define PROTO_ID_MASK GENMASK(31, 24)
#define EVT_ID_MASK GENMASK(23, 16)
#define SRC_ID_MASK GENMASK(15, 0)
@@ -1637,7 +1635,7 @@ int scmi_notification_init(struct scmi_handle *handle)
ni->gid = gid;
ni->handle = handle;
- ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
+ ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTOCOLS,
sizeof(char *), GFP_KERNEL);
if (!ni->registered_protocols)
goto err;
@@ -690,8 +690,11 @@ enum scmi_std_protocol {
SCMI_PROTOCOL_SENSOR = 0x15,
SCMI_PROTOCOL_RESET = 0x16,
SCMI_PROTOCOL_VOLTAGE = 0x17,
+ SCMI_PROTOCOL_LAST = 0xff,
};
+#define SCMI_MAX_PROTOCOLS (SCMI_PROTOCOL_LAST + 1)
+
enum scmi_system_events {
SCMI_SYSTEM_SHUTDOWN,
SCMI_SYSTEM_COLDRESET,
Add a common definition of SCMI_MAX_PROTOCOLS and use it all over the SCMI stack. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> --- drivers/firmware/arm_scmi/notify.c | 4 +--- include/linux/scmi_protocol.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-)