History

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.

Viresh Kumar committed 7 years ago

Commit 10b81821 parent cb772b81 file · +3 −4Browse files

Unified · Split

drivers/cpufreq/cpufreq_stats.c+3−4
@@ -51,6 +51,7 @@ static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf) · 50 unmodified lines
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) · 12 unmodified lines
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, · 2 unmodified lines
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) · 43 unmodified lines
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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t