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 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
12 ===================================================================
13 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.c
14 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
15 @@ -689,8 +689,8 @@ minstrel_alloc(struct ieee80211_hw *hw,
17 #ifdef CPTCFG_MAC80211_DEBUGFS
18 mp->fixed_rate_idx = (u32) -1;
19 - mp->dbg_fixed_rate = debugfs_create_u32("fixed_rate_idx",
20 - 0666, debugfsdir, &mp->fixed_rate_idx);
21 + debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
22 + &mp->fixed_rate_idx);
25 minstrel_init_cck_rates(mp);
26 @@ -701,9 +701,6 @@ minstrel_alloc(struct ieee80211_hw *hw,
28 minstrel_free(void *priv)
30 -#ifdef CPTCFG_MAC80211_DEBUGFS
31 - debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
36 @@ -735,7 +732,6 @@ const struct rate_control_ops mac80211_m
37 .free_sta = minstrel_free_sta,
38 #ifdef CPTCFG_MAC80211_DEBUGFS
39 .add_sta_debugfs = minstrel_add_sta_debugfs,
40 - .remove_sta_debugfs = minstrel_remove_sta_debugfs,
42 .get_expected_throughput = minstrel_get_expected_throughput,
44 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
45 ===================================================================
46 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.h
47 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
48 @@ -109,11 +109,6 @@ struct minstrel_sta_info {
53 -#ifdef CPTCFG_MAC80211_DEBUGFS
54 - struct dentry *dbg_stats;
55 - struct dentry *dbg_stats_csv;
59 struct minstrel_priv {
60 @@ -137,7 +132,6 @@ struct minstrel_priv {
61 * - setting will be applied on next update
64 - struct dentry *dbg_fixed_rate;
68 @@ -156,7 +150,6 @@ minstrel_get_ewmsd10(struct minstrel_rat
70 extern const struct rate_control_ops mac80211_minstrel;
71 void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
72 -void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
74 /* Recalculate success probabilities and counters for a given rate using EWMA */
75 void minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs);
76 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
77 ===================================================================
78 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_debugfs.c
79 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
80 @@ -214,19 +214,7 @@ minstrel_add_sta_debugfs(void *priv, voi
82 struct minstrel_sta_info *mi = priv_sta;
84 - mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
85 - &minstrel_stat_fops);
87 - mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
88 - &minstrel_stat_csv_fops);
92 -minstrel_remove_sta_debugfs(void *priv, void *priv_sta)
94 - struct minstrel_sta_info *mi = priv_sta;
96 - debugfs_remove(mi->dbg_stats);
98 - debugfs_remove(mi->dbg_stats_csv);
99 + debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
100 + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
101 + &minstrel_stat_csv_fops);
103 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
104 ===================================================================
105 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
106 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
107 @@ -1393,7 +1393,6 @@ static const struct rate_control_ops mac
108 .free = minstrel_ht_free,
109 #ifdef CPTCFG_MAC80211_DEBUGFS
110 .add_sta_debugfs = minstrel_ht_add_sta_debugfs,
111 - .remove_sta_debugfs = minstrel_ht_remove_sta_debugfs,
113 .get_expected_throughput = minstrel_ht_get_expected_throughput,
115 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
116 ===================================================================
117 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.h
118 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
119 @@ -110,17 +110,12 @@ struct minstrel_ht_sta_priv {
120 struct minstrel_ht_sta ht;
121 struct minstrel_sta_info legacy;
123 -#ifdef CPTCFG_MAC80211_DEBUGFS
124 - struct dentry *dbg_stats;
125 - struct dentry *dbg_stats_csv;
132 void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
133 -void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
134 int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
137 Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
138 ===================================================================
139 --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht_debugfs.c
140 +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
141 @@ -303,17 +303,8 @@ minstrel_ht_add_sta_debugfs(void *priv,
143 struct minstrel_ht_sta_priv *msp = priv_sta;
145 - msp->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, msp,
146 - &minstrel_ht_stat_fops);
147 - msp->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, msp,
148 - &minstrel_ht_stat_csv_fops);
152 -minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta)
154 - struct minstrel_ht_sta_priv *msp = priv_sta;
156 - debugfs_remove(msp->dbg_stats);
157 - debugfs_remove(msp->dbg_stats_csv);
158 + debugfs_create_file("rc_stats", S_IRUGO, dir, msp,
159 + &minstrel_ht_stat_fops);
160 + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, msp,
161 + &minstrel_ht_stat_csv_fops);