From ef18527db30a2d4b075d3173e61ae2cee0b1b8a3 Mon Sep 17 00:00:00 2001 From: Naveen Yadav Date: Thu, 19 Dec 2019 17:51:18 +0530 Subject: [PATCH] cpufreq: qcom-cpufreq-hw: Fix incorrect type warning from sparse The implicit typecast from void * to __iomem cause sparse to complain about incorrect type in initializer, so fix the same. Change-Id: I9690d76a9991667496011894f0a1fd83a7e23c1f Signed-off-by: Naveen Yadav --- drivers/cpufreq/qcom-cpufreq-hw.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index c434a9ba42a2..8de072fdeda3 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -37,7 +37,7 @@ enum { }; static unsigned long cpu_hw_rate, xo_rate; -static const u16 *offsets; +static const size_t *offsets; static unsigned int lut_row_size = LUT_ROW_SIZE; static bool accumulative_counter; @@ -113,9 +113,7 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, unsigned int index) { - void __iomem *base = policy->driver_data; - - writel_relaxed(index, base + offsets[REG_PERF_STATE]); + writel_relaxed(index, policy->driver_data + offsets[REG_PERF_STATE]); arch_set_freq_scale(policy->related_cpus, policy->freq_table[index].frequency, policy->cpuinfo.max_freq); @@ -126,16 +124,13 @@ qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, static unsigned int qcom_cpufreq_hw_get(unsigned int cpu) { struct cpufreq_policy *policy; - void __iomem *base; unsigned int index; policy = cpufreq_cpu_get_raw(cpu); if (!policy) return 0; - base = policy->driver_data; - - index = readl_relaxed(base + offsets[REG_PERF_STATE]); + index = readl_relaxed(policy->driver_data + offsets[REG_PERF_STATE]); index = min(index, LUT_MAX_ENTRIES - 1); return policy->freq_table[index].frequency;