The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH 1/3] cpufreq: arm_scmi: Constify scmi_perf_ops pointers
Date: Mon,  7 Sep 2020 01:04:50 +0200	[thread overview]
Message-ID: <20200906230452.33410-2-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200906230452.33410-1-rikard.falkeborn@gmail.com>

The perf_ops are not modified through this pointer. Make them const to
indicate that. This is in preparation to make the scmi-ops pointers in
scmi_handle const.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/cpufreq/scmi-cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index fb42e3390377..46b268095421 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -29,7 +29,7 @@ static const struct scmi_handle *handle;
 static unsigned int scmi_cpufreq_get_rate(unsigned int cpu)
 {
 	struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
-	struct scmi_perf_ops *perf_ops = handle->perf_ops;
+	const struct scmi_perf_ops *perf_ops = handle->perf_ops;
 	struct scmi_data *priv = policy->driver_data;
 	unsigned long rate;
 	int ret;
@@ -50,7 +50,7 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
 {
 	int ret;
 	struct scmi_data *priv = policy->driver_data;
-	struct scmi_perf_ops *perf_ops = handle->perf_ops;
+	const struct scmi_perf_ops *perf_ops = handle->perf_ops;
 	u64 freq = policy->freq_table[index].frequency;
 
 	ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
@@ -64,7 +64,7 @@ static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy,
 					     unsigned int target_freq)
 {
 	struct scmi_data *priv = policy->driver_data;
-	struct scmi_perf_ops *perf_ops = handle->perf_ops;
+	const struct scmi_perf_ops *perf_ops = handle->perf_ops;
 
 	if (!perf_ops->freq_set(handle, priv->domain_id,
 				target_freq * 1000, true)) {
-- 
2.28.0


  reply	other threads:[~2020-09-06 23:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 23:04 [PATCH 0/3] arm_scmi: Constify ops pointers in struct scmi_handle Rikard Falkeborn
2020-09-06 23:04 ` Rikard Falkeborn [this message]
2020-09-07 10:22   ` [PATCH 1/3] cpufreq: arm_scmi: Constify scmi_perf_ops pointers Sudeep Holla
2020-09-07 10:25     ` Viresh Kumar
2020-09-07 10:44       ` Sudeep Holla
2020-09-07 10:46         ` Viresh Kumar
2020-09-06 23:04 ` [PATCH 2/3] firmware: arm_scmi: Constify ops pointers in scmi_handle Rikard Falkeborn
2020-09-06 23:04 ` [PATCH 3/3] firmware: arm_scmi: Constify static scmi-ops Rikard Falkeborn
2020-09-08 12:51 ` [PATCH 0/3] arm_scmi: Constify ops pointers in struct scmi_handle Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200906230452.33410-2-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox