[CPUFREQ] kzalloc conversions for cpufreq core.
Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
Родитель
bfdc708dc7
Коммит
e98df50c52
|
@ -595,12 +595,11 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
|
||||||
goto module_out;
|
goto module_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
policy = kmalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
|
policy = kzalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
|
||||||
if (!policy) {
|
if (!policy) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto nomem_out;
|
goto nomem_out;
|
||||||
}
|
}
|
||||||
memset(policy, 0, sizeof(struct cpufreq_policy));
|
|
||||||
|
|
||||||
policy->cpu = cpu;
|
policy->cpu = cpu;
|
||||||
policy->cpus = cpumask_of_cpu(cpu);
|
policy->cpus = cpumask_of_cpu(cpu);
|
||||||
|
|
|
@ -192,9 +192,8 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
|
||||||
unsigned int cpu = policy->cpu;
|
unsigned int cpu = policy->cpu;
|
||||||
if (cpufreq_stats_table[cpu])
|
if (cpufreq_stats_table[cpu])
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
if ((stat = kmalloc(sizeof(struct cpufreq_stats), GFP_KERNEL)) == NULL)
|
if ((stat = kzalloc(sizeof(struct cpufreq_stats), GFP_KERNEL)) == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset(stat, 0, sizeof (struct cpufreq_stats));
|
|
||||||
|
|
||||||
data = cpufreq_cpu_get(cpu);
|
data = cpufreq_cpu_get(cpu);
|
||||||
if ((ret = sysfs_create_group(&data->kobj, &stats_attr_group)))
|
if ((ret = sysfs_create_group(&data->kobj, &stats_attr_group)))
|
||||||
|
@ -216,12 +215,11 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
|
||||||
alloc_size += count * count * sizeof(int);
|
alloc_size += count * count * sizeof(int);
|
||||||
#endif
|
#endif
|
||||||
stat->max_state = count;
|
stat->max_state = count;
|
||||||
stat->time_in_state = kmalloc(alloc_size, GFP_KERNEL);
|
stat->time_in_state = kzalloc(alloc_size, GFP_KERNEL);
|
||||||
if (!stat->time_in_state) {
|
if (!stat->time_in_state) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
memset(stat->time_in_state, 0, alloc_size);
|
|
||||||
stat->freq_table = (unsigned int *)(stat->time_in_state + count);
|
stat->freq_table = (unsigned int *)(stat->time_in_state + count);
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
|
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
|
||||||
|
|
Загрузка…
Ссылка в новой задаче