aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/sparc-us3-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-08-06 13:23:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-07 17:34:10 -0400
commitd5b73cd870e2b049ef566aec2791dbf5fd26a7ec (patch)
tree191f399b9ce03fd7a1b6820126823a0d3776e030 /drivers/cpufreq/sparc-us3-cpufreq.c
parent3a3e9e06d0c11b8efa95933a88c9e67209fa4330 (diff)
cpufreq: Use sizeof(*ptr) convetion for computing sizes
Chapter 14 of Documentation/CodingStyle says: The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); The alternative form where struct name is spelled out hurts readability and introduces an opportunity for a bug when the pointer variable type is changed but the corresponding sizeof that is passed to a memory allocator is not. This wasn't followed consistently in drivers/cpufreq, let's make it more consistent by always following this rule. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/sparc-us3-cpufreq.c')
-rw-r--r--drivers/cpufreq/sparc-us3-cpufreq.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
index 880ee293d61e..7f500c140bc3 100644
--- a/drivers/cpufreq/sparc-us3-cpufreq.c
+++ b/drivers/cpufreq/sparc-us3-cpufreq.c
@@ -212,12 +212,11 @@ static int __init us3_freq_init(void)
212 struct cpufreq_driver *driver; 212 struct cpufreq_driver *driver;
213 213
214 ret = -ENOMEM; 214 ret = -ENOMEM;
215 driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); 215 driver = kzalloc(sizeof(*driver), GFP_KERNEL);
216 if (!driver) 216 if (!driver)
217 goto err_out; 217 goto err_out;
218 218
219 us3_freq_table = kzalloc( 219 us3_freq_table = kzalloc((NR_CPUS * sizeof(*us3_freq_table)),
220 (NR_CPUS * sizeof(struct us3_freq_percpu_info)),
221 GFP_KERNEL); 220 GFP_KERNEL);
222 if (!us3_freq_table) 221 if (!us3_freq_table)
223 goto err_out; 222 goto err_out;