pxa3xx-cpufreq.c: Avoid using ARRAY_AND_SIZE(e) as a function argument
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 13 Aug 2013 13:02:25 +0000 (15:02 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Aug 2013 20:24:23 +0000 (22:24 +0200)
Replace ARRAY_AND_SIZE(e) in function argument position to avoid
hiding the arity of the called function.

The semantic match that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,f;
@@

f(...,
- ARRAY_AND_SIZE(e)
+ e,ARRAY_SIZE(e)
  ,...)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/pxa3xx-cpufreq.c

index 9c92ef032a9e978800e4897a2a3e8322c0d1c031..d26306fb00d2e8a749ed044c816533f101defd11 100644 (file)
@@ -213,10 +213,12 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy)
        policy->cur = policy->min = policy->max;
 
        if (cpu_is_pxa300() || cpu_is_pxa310())
-               ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa300_freqs));
+               ret = setup_freqs_table(policy, pxa300_freqs,
+                                       ARRAY_SIZE(pxa300_freqs));
 
        if (cpu_is_pxa320())
-               ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa320_freqs));
+               ret = setup_freqs_table(policy, pxa320_freqs,
+                                       ARRAY_SIZE(pxa320_freqs));
 
        if (ret) {
                pr_err("failed to setup frequency table\n");