diff mbox series

[1/3] cpufreq: arm_scmi: Constify scmi_perf_ops pointers

Message ID 20200906230452.33410-2-rikard.falkeborn@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show
Series arm_scmi: Constify ops pointers in struct scmi_handle | expand

Commit Message

Rikard Falkeborn Sept. 6, 2020, 11:04 p.m. UTC
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(-)

Comments

Sudeep Holla Sept. 7, 2020, 10:22 a.m. UTC | #1
Hi Viresh,

On Mon, Sep 07, 2020 at 01:04:50AM +0200, Rikard Falkeborn wrote:
> 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.
>

Your ack needed to take this as series via {arm-,}soc
Viresh Kumar Sept. 7, 2020, 10:25 a.m. UTC | #2
On 07-09-20, 11:22, Sudeep Holla wrote:
> Hi Viresh,
> 
> On Mon, Sep 07, 2020 at 01:04:50AM +0200, Rikard Falkeborn wrote:
> > 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.
> >
> 
> Your ack needed to take this as series via {arm-,}soc

Can I just pick the first patch and you do the rest ? Will it result
in any warnings at either end ?
Sudeep Holla Sept. 7, 2020, 10:44 a.m. UTC | #3
On Mon, Sep 07, 2020 at 03:55:51PM +0530, Viresh Kumar wrote:
> On 07-09-20, 11:22, Sudeep Holla wrote:
> > Hi Viresh,
> >
> > On Mon, Sep 07, 2020 at 01:04:50AM +0200, Rikard Falkeborn wrote:
> > > 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.
> > >
> >
> > Your ack needed to take this as series via {arm-,}soc
>
> Can I just pick the first patch and you do the rest ? Will it result
> in any warnings at either end ?
>

Initially I thought out suggesting the same, but then I realised(not
checked though), without this change in arm-soc the scmi-cpufreq driver
might produce warnings as the const value gets assigned to non const.
No ?

--
Regards,
Sudeep
Viresh Kumar Sept. 7, 2020, 10:46 a.m. UTC | #4
On 07-09-20, 11:44, Sudeep Holla wrote:
> On Mon, Sep 07, 2020 at 03:55:51PM +0530, Viresh Kumar wrote:
> > On 07-09-20, 11:22, Sudeep Holla wrote:
> > > Hi Viresh,
> > >
> > > On Mon, Sep 07, 2020 at 01:04:50AM +0200, Rikard Falkeborn wrote:
> > > > 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.
> > > >
> > >
> > > Your ack needed to take this as series via {arm-,}soc
> >
> > Can I just pick the first patch and you do the rest ? Will it result
> > in any warnings at either end ?
> >
> 
> Initially I thought out suggesting the same, but then I realised(not
> checked though), without this change in arm-soc the scmi-cpufreq driver
> might produce warnings as the const value gets assigned to non const.
> No ?

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
diff mbox series

Patch

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)) {