1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 10 Feb 2018 12:41:51 +0100
3 Subject: [PATCH] mac80211: minstrel: remove unnecessary debugfs cleanup
6 debugfs entries are cleaned up by debugfs_remove_recursive already.
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/rc80211_minstrel.c
12 +++ b/net/mac80211/rc80211_minstrel.c
13 @@ -689,8 +689,8 @@ minstrel_alloc(struct ieee80211_hw *hw,
15 #ifdef CPTCFG_MAC80211_DEBUGFS
16 mp->fixed_rate_idx = (u32) -1;
17 - mp->dbg_fixed_rate = debugfs_create_u32("fixed_rate_idx",
18 - 0666, debugfsdir, &mp->fixed_rate_idx);
19 + debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
20 + &mp->fixed_rate_idx);
23 minstrel_init_cck_rates(mp);
24 @@ -701,9 +701,6 @@ minstrel_alloc(struct ieee80211_hw *hw,
26 minstrel_free(void *priv)
28 -#ifdef CPTCFG_MAC80211_DEBUGFS
29 - debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
34 @@ -735,7 +732,6 @@ const struct rate_control_ops mac80211_m
35 .free_sta = minstrel_free_sta,
36 #ifdef CPTCFG_MAC80211_DEBUGFS
37 .add_sta_debugfs = minstrel_add_sta_debugfs,
38 - .remove_sta_debugfs = minstrel_remove_sta_debugfs,
40 .get_expected_throughput = minstrel_get_expected_throughput,
42 --- a/net/mac80211/rc80211_minstrel.h
43 +++ b/net/mac80211/rc80211_minstrel.h
44 @@ -109,11 +109,6 @@ struct minstrel_sta_info {
49 -#ifdef CPTCFG_MAC80211_DEBUGFS
50 - struct dentry *dbg_stats;
51 - struct dentry *dbg_stats_csv;
55 struct minstrel_priv {
56 @@ -137,7 +132,6 @@ struct minstrel_priv {
57 * - setting will be applied on next update
60 - struct dentry *dbg_fixed_rate;
64 @@ -156,7 +150,6 @@ minstrel_get_ewmsd10(struct minstrel_rat
66 extern const struct rate_control_ops mac80211_minstrel;
67 void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
68 -void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
70 /* Recalculate success probabilities and counters for a given rate using EWMA */
71 void minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs);
72 --- a/net/mac80211/rc80211_minstrel_debugfs.c
73 +++ b/net/mac80211/rc80211_minstrel_debugfs.c
74 @@ -214,19 +214,7 @@ minstrel_add_sta_debugfs(void *priv, voi
76 struct minstrel_sta_info *mi = priv_sta;
78 - mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
79 - &minstrel_stat_fops);
81 - mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
82 - &minstrel_stat_csv_fops);
86 -minstrel_remove_sta_debugfs(void *priv, void *priv_sta)
88 - struct minstrel_sta_info *mi = priv_sta;
90 - debugfs_remove(mi->dbg_stats);
92 - debugfs_remove(mi->dbg_stats_csv);
93 + debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
94 + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
95 + &minstrel_stat_csv_fops);
97 --- a/net/mac80211/rc80211_minstrel_ht.c
98 +++ b/net/mac80211/rc80211_minstrel_ht.c
99 @@ -1393,7 +1393,6 @@ static const struct rate_control_ops mac
100 .free = minstrel_ht_free,
101 #ifdef CPTCFG_MAC80211_DEBUGFS
102 .add_sta_debugfs = minstrel_ht_add_sta_debugfs,
103 - .remove_sta_debugfs = minstrel_ht_remove_sta_debugfs,
105 .get_expected_throughput = minstrel_ht_get_expected_throughput,
107 --- a/net/mac80211/rc80211_minstrel_ht.h
108 +++ b/net/mac80211/rc80211_minstrel_ht.h
109 @@ -110,17 +110,12 @@ struct minstrel_ht_sta_priv {
110 struct minstrel_ht_sta ht;
111 struct minstrel_sta_info legacy;
113 -#ifdef CPTCFG_MAC80211_DEBUGFS
114 - struct dentry *dbg_stats;
115 - struct dentry *dbg_stats_csv;
122 void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
123 -void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
124 int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
127 --- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
128 +++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
129 @@ -303,17 +303,8 @@ minstrel_ht_add_sta_debugfs(void *priv,
131 struct minstrel_ht_sta_priv *msp = priv_sta;
133 - msp->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, msp,
134 - &minstrel_ht_stat_fops);
135 - msp->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, msp,
136 - &minstrel_ht_stat_csv_fops);
140 -minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta)
142 - struct minstrel_ht_sta_priv *msp = priv_sta;
144 - debugfs_remove(msp->dbg_stats);
145 - debugfs_remove(msp->dbg_stats_csv);
146 + debugfs_create_file("rc_stats", S_IRUGO, dir, msp,
147 + &minstrel_ht_stat_fops);
148 + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, msp,
149 + &minstrel_ht_stat_csv_fops);