Re: [PATCH 2/2] cpufreq: drivers: Remove unnecessary assignments ofpolicy-> members

From: Viresh Kumar
Date: Mon Mar 25 2013 - 06:24:22 EST


On 25 March 2013 15:11, Sekhar Nori <nsekhar@xxxxxx> wrote:
> So down in the cpufreq driver probe below, we bail out if freq_table is
> not provided. So all this checking for freq_table in the code you pasted
> above is superfluous. If you can clean that part up and add checking for
> cpufreq_frequency_table_cpuinfo() as you proposed, I will be glad to
> test it out ;)

Attached is the complete patch and following is your fixup for davinci
(just to review):

diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index ff46862..7c2e943 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -137,18 +137,17 @@ static int davinci_cpu_init(struct cpufreq_policy *policy)
return result;
}

- policy->cur = policy->min = policy->max = davinci_getspeed(0);
-
- if (freq_table) {
- result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
- if (!result)
- cpufreq_frequency_table_get_attr(freq_table,
- policy->cpu);
- } else {
- policy->cpuinfo.min_freq = policy->min;
- policy->cpuinfo.max_freq = policy->max;
+ policy->cur = davinci_getspeed(0);
+
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+ if (result) {
+ pr_err("%s: cpufreq_frequency_table_cpuinfo() failed",
+ __func__);
+ return result;
}

+ cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
+
/*
* Time measurement across the target() function yields ~1500-1800us
* time taken with no drivers on notification list.

Attachment: 0001-cpufreq-drivers-Remove-unnecessary-assignments-of-po.patch
Description: Binary data