Skip to content

Commit 10b8182

Browse files
vireshkrafaeljw
authored andcommitted
cpufreq: stats: Declare freq-attr right after their callbacks
Freq attribute for "trans_table" is defined right after its callback (without any blank line between them), but the others are defined separately later on. Keep this consistent and define all attributes right after their callbacks. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent cb772b8 commit 10b8182

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/cpufreq/cpufreq_stats.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf)
5151
{
5252
return sprintf(buf, "%d\n", policy->stats->total_trans);
5353
}
54+
cpufreq_freq_attr_ro(total_trans);
5455

5556
static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
5657
{
@@ -69,6 +70,7 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
6970
}
7071
return len;
7172
}
73+
cpufreq_freq_attr_ro(time_in_state);
7274

7375
static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,
7476
size_t count)
@@ -77,6 +79,7 @@ static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,
7779
cpufreq_stats_clear_table(policy->stats);
7880
return count;
7981
}
82+
cpufreq_freq_attr_wo(reset);
8083

8184
static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
8285
{
@@ -126,10 +129,6 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
126129
}
127130
cpufreq_freq_attr_ro(trans_table);
128131

129-
cpufreq_freq_attr_ro(total_trans);
130-
cpufreq_freq_attr_ro(time_in_state);
131-
cpufreq_freq_attr_wo(reset);
132-
133132
static struct attribute *default_attrs[] = {
134133
&total_trans.attr,
135134
&time_in_state.attr,

0 commit comments

Comments
 (0)