]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/cpufreq/cpufreq_stats.c
cpufreq: Use sizeof(*ptr) convetion for computing sizes
[mirror_ubuntu-bionic-kernel.git] / drivers / cpufreq / cpufreq_stats.c
index cb3841355454f0d79b73db914f59328a4400c99e..04452f026ed085a7b61f87c623c8677a2e242864 100644 (file)
@@ -9,17 +9,10 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/kernel.h>
-#include <linux/slab.h>
 #include <linux/cpu.h>
-#include <linux/sysfs.h>
 #include <linux/cpufreq.h>
 #include <linux/module.h>
-#include <linux/jiffies.h>
-#include <linux/percpu.h>
-#include <linux/kobject.h>
-#include <linux/spinlock.h>
-#include <linux/notifier.h>
+#include <linux/slab.h>
 #include <asm/cputime.h>
 
 static spinlock_t cpufreq_stats_lock;
@@ -200,22 +193,22 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
 {
        unsigned int i, j, count = 0, ret = 0;
        struct cpufreq_stats *stat;
-       struct cpufreq_policy *data;
+       struct cpufreq_policy *current_policy;
        unsigned int alloc_size;
        unsigned int cpu = policy->cpu;
        if (per_cpu(cpufreq_stats_table, cpu))
                return -EBUSY;
-       stat = kzalloc(sizeof(struct cpufreq_stats), GFP_KERNEL);
+       stat = kzalloc(sizeof(*stat), GFP_KERNEL);
        if ((stat) == NULL)
                return -ENOMEM;
 
-       data = cpufreq_cpu_get(cpu);
-       if (data == NULL) {
+       current_policy = cpufreq_cpu_get(cpu);
+       if (current_policy == NULL) {
                ret = -EINVAL;
                goto error_get_fail;
        }
 
-       ret = sysfs_create_group(&data->kobj, &stats_attr_group);
+       ret = sysfs_create_group(&current_policy->kobj, &stats_attr_group);
        if (ret)
                goto error_out;
 
@@ -258,10 +251,10 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
        stat->last_time = get_jiffies_64();
        stat->last_index = freq_table_get_index(stat, policy->cur);
        spin_unlock(&cpufreq_stats_lock);
-       cpufreq_cpu_put(data);
+       cpufreq_cpu_put(current_policy);
        return 0;
 error_out:
-       cpufreq_cpu_put(data);
+       cpufreq_cpu_put(current_policy);
 error_get_fail:
        kfree(stat);
        per_cpu(cpufreq_stats_table, cpu) = NULL;