History

firmware: arm_scmi: Make name_get operations return a const

A few protocol operations are available that returns a pointer to an internal character array representing resource name. Make those functions return a const pointer to such array.

Cristian Marussi committed 4 years ago

Commit 992be5d1 parent 776b6c83 files · +9 −6Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/scmi_protocol.h+4−2
@@ -146,7 +146,8 @@ struct scmi_perf_proto_ops { · 145 unmodified lines
146146 */
147147 struct scmi_power_proto_ops {
148148 int (*num_domains_get)(const struct scmi_protocol_handle *ph);
149− char *(*name_get)(const struct scmi_protocol_handle *ph, u32 domain);
149+ const char *(*name_get)(const struct scmi_protocol_handle *ph,
150+ u32 domain);
150151 #define SCMI_POWER_STATE_TYPE_SHIFT 30
151152 #define SCMI_POWER_STATE_ID_MASK (BIT(28) - 1)
152153 #define SCMI_POWER_STATE_PARAM(type, id) \
@@ -484,7 +485,8 @@ struct scmi_sensor_proto_ops { · 331 unmodified lines
484485 */
485486 struct scmi_reset_proto_ops {
486487 int (*num_domains_get)(const struct scmi_protocol_handle *ph);
487− char *(*name_get)(const struct scmi_protocol_handle *ph, u32 domain);
488+ const char *(*name_get)(const struct scmi_protocol_handle *ph,
489+ u32 domain);
488490 int (*latency_get)(const struct scmi_protocol_handle *ph, u32 domain);
489491 int (*reset)(const struct scmi_protocol_handle *ph, u32 domain);
490492 int (*assert)(const struct scmi_protocol_handle *ph, u32 domain);