aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/acpi-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/acpi-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/acpi-cpufreq.c')
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index e673670d2321..44758ce9936d 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -709,7 +709,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
709 return blacklisted; 709 return blacklisted;
710#endif 710#endif
711 711
712 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL); 712 data = kzalloc(sizeof(*data), GFP_KERNEL);
713 if (!data) 713 if (!data)
714 return -ENOMEM; 714 return -ENOMEM;
715 715
@@ -799,7 +799,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
799 goto err_unreg; 799 goto err_unreg;
800 } 800 }
801 801
802 data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) * 802 data->freq_table = kmalloc(sizeof(*data->freq_table) *
803 (perf->state_count+1), GFP_KERNEL); 803 (perf->state_count+1), GFP_KERNEL);
804 if (!data->freq_table) { 804 if (!data->freq_table) {
805 result = -ENOMEM; 805 result = -ENOMEM;