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.
Unified · Split
| @@ -174,8 +174,9 @@ static int scmi_power_num_domains_get(const struct scmi_protocol_handle *ph) · 173 unmodified lines | ||
| 174 | 174 | return pi->num_domains; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | −static char *scmi_power_name_get(const struct scmi_protocol_handle *ph, | |
| 178 | − u32 domain) | |
| 177 | +static const char * | |
| 178 | +scmi_power_name_get(const struct scmi_protocol_handle *ph, | |
| 179 | + u32 domain) | |
| 179 | 180 | { |
| 180 | 181 | struct scmi_power_info *pi = ph->get_priv(ph); |
| 181 | 182 | struct power_dom_info *dom = pi->dom_info + domain; |
| @@ -126,8 +126,8 @@ static int scmi_reset_num_domains_get(const struct scmi_protocol_handle *ph) · 125 unmodified lines | ||
| 126 | 126 | return pi->num_domains; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | −static char *scmi_reset_name_get(const struct scmi_protocol_handle *ph, | |
| 130 | − u32 domain) | |
| 129 | +static const char * | |
| 130 | +scmi_reset_name_get(const struct scmi_protocol_handle *ph, u32 domain) | |
| 131 | 131 | { |
| 132 | 132 | struct scmi_reset_info *pi = ph->get_priv(ph); |
| 133 | 133 | |
| @@ -146,7 +146,8 @@ struct scmi_perf_proto_ops { · 145 unmodified lines | ||
| 146 | 146 | */ |
| 147 | 147 | struct scmi_power_proto_ops { |
| 148 | 148 | 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); | |
| 150 | 151 | #define SCMI_POWER_STATE_TYPE_SHIFT 30 |
| 151 | 152 | #define SCMI_POWER_STATE_ID_MASK (BIT(28) - 1) |
| 152 | 153 | #define SCMI_POWER_STATE_PARAM(type, id) \ |
| @@ -484,7 +485,8 @@ struct scmi_sensor_proto_ops { · 331 unmodified lines | ||
| 484 | 485 | */ |
| 485 | 486 | struct scmi_reset_proto_ops { |
| 486 | 487 | 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); | |
| 488 | 490 | int (*latency_get)(const struct scmi_protocol_handle *ph, u32 domain); |
| 489 | 491 | int (*reset)(const struct scmi_protocol_handle *ph, u32 domain); |
| 490 | 492 | int (*assert)(const struct scmi_protocol_handle *ph, u32 domain); |