Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: stats: Clean up local variable in cpufreq_stats_create_table()

Local variable 'count' will be initialized and 'ret' is also not
required, so remove the redundant initialization and get rid of
'ret'.

Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Shaokun Zhang and committed by
Rafael J. Wysocki
5de12625 8df71a7d

+2 -3
+2 -3
drivers/cpufreq/cpufreq_stats.c
··· 211 211 212 212 void cpufreq_stats_create_table(struct cpufreq_policy *policy) 213 213 { 214 - unsigned int i = 0, count = 0, ret = -ENOMEM; 214 + unsigned int i = 0, count; 215 215 struct cpufreq_stats *stats; 216 216 unsigned int alloc_size; 217 217 struct cpufreq_frequency_table *pos; ··· 253 253 stats->last_index = freq_table_get_index(stats, policy->cur); 254 254 255 255 policy->stats = stats; 256 - ret = sysfs_create_group(&policy->kobj, &stats_attr_group); 257 - if (!ret) 256 + if (!sysfs_create_group(&policy->kobj, &stats_attr_group)) 258 257 return; 259 258 260 259 /* We failed, release resources */