diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-08-06 13:23:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-07 17:34:10 -0400 |
commit | d5b73cd870e2b049ef566aec2791dbf5fd26a7ec (patch) | |
tree | 191f399b9ce03fd7a1b6820126823a0d3776e030 /drivers/cpufreq/cpufreq_ondemand.c | |
parent | 3a3e9e06d0c11b8efa95933a88c9e67209fa4330 (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/cpufreq_ondemand.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 47d4b69be7c6..117278ab5869 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -482,7 +482,7 @@ static int od_init(struct dbs_data *dbs_data) | |||
482 | u64 idle_time; | 482 | u64 idle_time; |
483 | int cpu; | 483 | int cpu; |
484 | 484 | ||
485 | tuners = kzalloc(sizeof(struct od_dbs_tuners), GFP_KERNEL); | 485 | tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); |
486 | if (!tuners) { | 486 | if (!tuners) { |
487 | pr_err("%s: kzalloc failed\n", __func__); | 487 | pr_err("%s: kzalloc failed\n", __func__); |
488 | return -ENOMEM; | 488 | return -ENOMEM; |