Skip to content

Commit 5de1262

Browse files
zhangshkrafaeljw
authored andcommitted
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 <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 8df71a7 commit 5de1262

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/cpufreq/cpufreq_stats.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void cpufreq_stats_free_table(struct cpufreq_policy *policy)
211211

212212
void cpufreq_stats_create_table(struct cpufreq_policy *policy)
213213
{
214-
unsigned int i = 0, count = 0, ret = -ENOMEM;
214+
unsigned int i = 0, count;
215215
struct cpufreq_stats *stats;
216216
unsigned int alloc_size;
217217
struct cpufreq_frequency_table *pos;
@@ -253,8 +253,7 @@ void cpufreq_stats_create_table(struct cpufreq_policy *policy)
253253
stats->last_index = freq_table_get_index(stats, policy->cur);
254254

255255
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))
258257
return;
259258

260259
/* We failed, release resources */

0 commit comments

Comments
 (0)