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
51{51{
52 return sprintf(buf, "%d\n", policy->stats->total_trans);52 return sprintf(buf, "%d\n", policy->stats->total_trans);
53}53}
54cpufreq_freq_attr_ro(total_trans);
54 55
55static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)56static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
56{57{
@@ -69,6 +70,7 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) · 12 unmodified lines
69 }70 }
70 return len;71 return len;
71}72}
73cpufreq_freq_attr_ro(time_in_state);
72 74
73static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,75static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,
74 size_t count)76 size_t count)
@@ -77,6 +79,7 @@ static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf, · 2 unmodified lines
77 cpufreq_stats_clear_table(policy->stats);79 cpufreq_stats_clear_table(policy->stats);
78 return count;80 return count;
79}81}
82cpufreq_freq_attr_wo(reset);
80 83
81static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)84static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
82{85{
@@ -126,10 +129,6 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) · 43 unmodified lines
126}129}
127cpufreq_freq_attr_ro(trans_table);130cpufreq_freq_attr_ro(trans_table);
128 131
129cpufreq_freq_attr_ro(total_trans);
130cpufreq_freq_attr_ro(time_in_state);
131cpufreq_freq_attr_wo(reset);
132
133static struct attribute *default_attrs[] = {132static struct attribute *default_attrs[] = {
134 &total_trans.attr,133 &total_trans.attr,
135 &time_in_state.attr,134 &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