Commit 3de7b830 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Sudeep Holla

firmware: arm_scmi: Constify static scmi-ops

These are never modified, so make them const to allow the compiler to
put them in read-only memory.

Link: https://lore.kernel.org/r/20200906230452.33410-4-rikard.falkeborn@gmail.comSigned-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 82894c1d
...@@ -318,7 +318,7 @@ scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id) ...@@ -318,7 +318,7 @@ scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id)
return clk; return clk;
} }
static struct scmi_clk_ops clk_ops = { static const struct scmi_clk_ops clk_ops = {
.count_get = scmi_clock_count_get, .count_get = scmi_clock_count_get,
.info_get = scmi_clock_info_get, .info_get = scmi_clock_info_get,
.rate_get = scmi_clock_rate_get, .rate_get = scmi_clock_rate_get,
......
...@@ -210,7 +210,7 @@ struct scmi_transport_ops { ...@@ -210,7 +210,7 @@ struct scmi_transport_ops {
* @max_msg_size: Maximum size of data per message that can be handled. * @max_msg_size: Maximum size of data per message that can be handled.
*/ */
struct scmi_desc { struct scmi_desc {
struct scmi_transport_ops *ops; const struct scmi_transport_ops *ops;
int max_rx_timeout_ms; int max_rx_timeout_ms;
int max_msg; int max_msg;
int max_msg_size; int max_msg_size;
......
...@@ -181,7 +181,7 @@ mailbox_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer) ...@@ -181,7 +181,7 @@ mailbox_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer)
return shmem_poll_done(smbox->shmem, xfer); return shmem_poll_done(smbox->shmem, xfer);
} }
static struct scmi_transport_ops scmi_mailbox_ops = { static const struct scmi_transport_ops scmi_mailbox_ops = {
.chan_available = mailbox_chan_available, .chan_available = mailbox_chan_available,
.chan_setup = mailbox_chan_setup, .chan_setup = mailbox_chan_setup,
.chan_free = mailbox_chan_free, .chan_free = mailbox_chan_free,
......
...@@ -1421,7 +1421,7 @@ static void scmi_protocols_late_init(struct work_struct *work) ...@@ -1421,7 +1421,7 @@ static void scmi_protocols_late_init(struct work_struct *work)
* notify_ops are attached to the handle so that can be accessed * notify_ops are attached to the handle so that can be accessed
* directly from an scmi_driver to register its own notifiers. * directly from an scmi_driver to register its own notifiers.
*/ */
static struct scmi_notify_ops notify_ops = { static const struct scmi_notify_ops notify_ops = {
.register_event_notifier = scmi_register_notifier, .register_event_notifier = scmi_register_notifier,
.unregister_event_notifier = scmi_unregister_notifier, .unregister_event_notifier = scmi_unregister_notifier,
}; };
......
...@@ -748,7 +748,7 @@ static bool scmi_fast_switch_possible(const struct scmi_handle *handle, ...@@ -748,7 +748,7 @@ static bool scmi_fast_switch_possible(const struct scmi_handle *handle,
return dom->fc_info && dom->fc_info->level_set_addr; return dom->fc_info && dom->fc_info->level_set_addr;
} }
static struct scmi_perf_ops perf_ops = { static const struct scmi_perf_ops perf_ops = {
.limits_set = scmi_perf_limits_set, .limits_set = scmi_perf_limits_set,
.limits_get = scmi_perf_limits_get, .limits_get = scmi_perf_limits_get,
.level_set = scmi_perf_level_set, .level_set = scmi_perf_level_set,
......
...@@ -184,7 +184,7 @@ static char *scmi_power_name_get(const struct scmi_handle *handle, u32 domain) ...@@ -184,7 +184,7 @@ static char *scmi_power_name_get(const struct scmi_handle *handle, u32 domain)
return dom->name; return dom->name;
} }
static struct scmi_power_ops power_ops = { static const struct scmi_power_ops power_ops = {
.num_domains_get = scmi_power_num_domains_get, .num_domains_get = scmi_power_num_domains_get,
.name_get = scmi_power_name_get, .name_get = scmi_power_name_get,
.state_set = scmi_power_state_set, .state_set = scmi_power_state_set,
......
...@@ -194,7 +194,7 @@ scmi_reset_domain_deassert(const struct scmi_handle *handle, u32 domain) ...@@ -194,7 +194,7 @@ scmi_reset_domain_deassert(const struct scmi_handle *handle, u32 domain)
return scmi_domain_reset(handle, domain, 0, ARCH_COLD_RESET); return scmi_domain_reset(handle, domain, 0, ARCH_COLD_RESET);
} }
static struct scmi_reset_ops reset_ops = { static const struct scmi_reset_ops reset_ops = {
.num_domains_get = scmi_reset_num_domains_get, .num_domains_get = scmi_reset_num_domains_get,
.name_get = scmi_reset_name_get, .name_get = scmi_reset_name_get,
.latency_get = scmi_reset_latency_get, .latency_get = scmi_reset_latency_get,
......
...@@ -275,7 +275,7 @@ static int scmi_sensor_count_get(const struct scmi_handle *handle) ...@@ -275,7 +275,7 @@ static int scmi_sensor_count_get(const struct scmi_handle *handle)
return si->num_sensors; return si->num_sensors;
} }
static struct scmi_sensor_ops sensor_ops = { static const struct scmi_sensor_ops sensor_ops = {
.count_get = scmi_sensor_count_get, .count_get = scmi_sensor_count_get,
.info_get = scmi_sensor_info_get, .info_get = scmi_sensor_info_get,
.trip_point_config = scmi_sensor_trip_point_config, .trip_point_config = scmi_sensor_trip_point_config,
......
...@@ -137,7 +137,7 @@ smc_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer) ...@@ -137,7 +137,7 @@ smc_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer)
return shmem_poll_done(scmi_info->shmem, xfer); return shmem_poll_done(scmi_info->shmem, xfer);
} }
static struct scmi_transport_ops scmi_smc_ops = { static const struct scmi_transport_ops scmi_smc_ops = {
.chan_available = smc_chan_available, .chan_available = smc_chan_available,
.chan_setup = smc_chan_setup, .chan_setup = smc_chan_setup,
.chan_free = smc_chan_free, .chan_free = smc_chan_free,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment