c871655a381616ec04b0c8dc216e684d32c0ef0a
[oweals/openwrt.git] /
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
4  code
5
6 debugfs entries are cleaned up by debugfs_remove_recursive already.
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
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,
16  
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);
23  #endif
24  
25         minstrel_init_cck_rates(mp);
26 @@ -701,9 +701,6 @@ minstrel_alloc(struct ieee80211_hw *hw,
27  static void
28  minstrel_free(void *priv)
29  {
30 -#ifdef CPTCFG_MAC80211_DEBUGFS
31 -       debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
32 -#endif
33         kfree(priv);
34  }
35  
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,
41  #endif
42         .get_expected_throughput = minstrel_get_expected_throughput,
43  };
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 {
49  
50         /* sampling table */
51         u8 *sample_table;
52 -
53 -#ifdef CPTCFG_MAC80211_DEBUGFS
54 -       struct dentry *dbg_stats;
55 -       struct dentry *dbg_stats_csv;
56 -#endif
57  };
58  
59  struct minstrel_priv {
60 @@ -137,7 +132,6 @@ struct minstrel_priv {
61          *   - setting will be applied on next update
62          */
63         u32 fixed_rate_idx;
64 -       struct dentry *dbg_fixed_rate;
65  #endif
66  };
67  
68 @@ -156,7 +150,6 @@ minstrel_get_ewmsd10(struct minstrel_rat
69  
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);
73  
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
81  {
82         struct minstrel_sta_info *mi = priv_sta;
83  
84 -       mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
85 -                                           &minstrel_stat_fops);
86 -
87 -       mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
88 -                                               &minstrel_stat_csv_fops);
89 -}
90 -
91 -void
92 -minstrel_remove_sta_debugfs(void *priv, void *priv_sta)
93 -{
94 -       struct minstrel_sta_info *mi = priv_sta;
95 -
96 -       debugfs_remove(mi->dbg_stats);
97 -
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);
102  }
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,
112  #endif
113         .get_expected_throughput = minstrel_ht_get_expected_throughput,
114  };
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;
122         };
123 -#ifdef CPTCFG_MAC80211_DEBUGFS
124 -       struct dentry *dbg_stats;
125 -       struct dentry *dbg_stats_csv;
126 -#endif
127         void *ratelist;
128         void *sample_table;
129         bool is_ht;
130  };
131  
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,
135                            int prob_ewma);
136  
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,
142  {
143         struct minstrel_ht_sta_priv *msp = priv_sta;
144  
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);
149 -}
150 -
151 -void
152 -minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta)
153 -{
154 -       struct minstrel_ht_sta_priv *msp = priv_sta;
155 -
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);
162  }