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

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.com


Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 82894c1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id)
	return clk;
}

static struct scmi_clk_ops clk_ops = {
static const struct scmi_clk_ops clk_ops = {
	.count_get = scmi_clock_count_get,
	.info_get = scmi_clock_info_get,
	.rate_get = scmi_clock_rate_get,
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ struct scmi_transport_ops {
 * @max_msg_size: Maximum size of data per message that can be handled.
 */
struct scmi_desc {
	struct scmi_transport_ops *ops;
	const struct scmi_transport_ops *ops;
	int max_rx_timeout_ms;
	int max_msg;
	int max_msg_size;
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ mailbox_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *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_setup = mailbox_chan_setup,
	.chan_free = mailbox_chan_free,
+1 −1
Original line number Diff line number Diff line
@@ -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
 * 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,
	.unregister_event_notifier = scmi_unregister_notifier,
};
+1 −1
Original line number Diff line number Diff line
@@ -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;
}

static struct scmi_perf_ops perf_ops = {
static const struct scmi_perf_ops perf_ops = {
	.limits_set = scmi_perf_limits_set,
	.limits_get = scmi_perf_limits_get,
	.level_set = scmi_perf_level_set,
Loading