cpufreq: Use sizeof(*ptr) convetion for computing sizes
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Aug 2013 17:23:06 +0000 (22:53 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Aug 2013 21:34:10 +0000 (23:34 +0200)
commitd5b73cd870e2b049ef566aec2791dbf5fd26a7ec
tree191f399b9ce03fd7a1b6820126823a0d3776e030
parent3a3e9e06d0c11b8efa95933a88c9e67209fa4330
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>
15 files changed:
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_stats.c
drivers/cpufreq/e_powersaver.c
drivers/cpufreq/exynos-cpufreq.c
drivers/cpufreq/gx-suspmod.c
drivers/cpufreq/ia64-acpi-cpufreq.c
drivers/cpufreq/pmac64-cpufreq.c
drivers/cpufreq/powernow-k7.c
drivers/cpufreq/powernow-k8.c
drivers/cpufreq/s3c24xx-cpufreq.c
drivers/cpufreq/sparc-us2e-cpufreq.c
drivers/cpufreq/sparc-us3-cpufreq.c