370-mac80211-minstrel-remove-unnecessary-debugfs-cleanup.patch 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. From: Felix Fietkau <[email protected]>
  2. Date: Sat, 10 Feb 2018 12:41:51 +0100
  3. Subject: [PATCH] mac80211: minstrel: remove unnecessary debugfs cleanup
  4. code
  5. debugfs entries are cleaned up by debugfs_remove_recursive already.
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
  9. ===================================================================
  10. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.c
  11. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
  12. @@ -689,8 +689,8 @@ minstrel_alloc(struct ieee80211_hw *hw,
  13. #ifdef CPTCFG_MAC80211_DEBUGFS
  14. mp->fixed_rate_idx = (u32) -1;
  15. - mp->dbg_fixed_rate = debugfs_create_u32("fixed_rate_idx",
  16. - 0666, debugfsdir, &mp->fixed_rate_idx);
  17. + debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
  18. + &mp->fixed_rate_idx);
  19. #endif
  20. minstrel_init_cck_rates(mp);
  21. @@ -701,9 +701,6 @@ minstrel_alloc(struct ieee80211_hw *hw,
  22. static void
  23. minstrel_free(void *priv)
  24. {
  25. -#ifdef CPTCFG_MAC80211_DEBUGFS
  26. - debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
  27. -#endif
  28. kfree(priv);
  29. }
  30. @@ -735,7 +732,6 @@ const struct rate_control_ops mac80211_m
  31. .free_sta = minstrel_free_sta,
  32. #ifdef CPTCFG_MAC80211_DEBUGFS
  33. .add_sta_debugfs = minstrel_add_sta_debugfs,
  34. - .remove_sta_debugfs = minstrel_remove_sta_debugfs,
  35. #endif
  36. .get_expected_throughput = minstrel_get_expected_throughput,
  37. };
  38. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
  39. ===================================================================
  40. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.h
  41. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
  42. @@ -109,11 +109,6 @@ struct minstrel_sta_info {
  43. /* sampling table */
  44. u8 *sample_table;
  45. -
  46. -#ifdef CPTCFG_MAC80211_DEBUGFS
  47. - struct dentry *dbg_stats;
  48. - struct dentry *dbg_stats_csv;
  49. -#endif
  50. };
  51. struct minstrel_priv {
  52. @@ -137,7 +132,6 @@ struct minstrel_priv {
  53. * - setting will be applied on next update
  54. */
  55. u32 fixed_rate_idx;
  56. - struct dentry *dbg_fixed_rate;
  57. #endif
  58. };
  59. @@ -156,7 +150,6 @@ minstrel_get_ewmsd10(struct minstrel_rat
  60. extern const struct rate_control_ops mac80211_minstrel;
  61. void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
  62. -void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
  63. /* Recalculate success probabilities and counters for a given rate using EWMA */
  64. void minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs);
  65. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
  66. ===================================================================
  67. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_debugfs.c
  68. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
  69. @@ -214,19 +214,7 @@ minstrel_add_sta_debugfs(void *priv, voi
  70. {
  71. struct minstrel_sta_info *mi = priv_sta;
  72. - mi->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, mi,
  73. - &minstrel_stat_fops);
  74. -
  75. - mi->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, mi,
  76. - &minstrel_stat_csv_fops);
  77. -}
  78. -
  79. -void
  80. -minstrel_remove_sta_debugfs(void *priv, void *priv_sta)
  81. -{
  82. - struct minstrel_sta_info *mi = priv_sta;
  83. -
  84. - debugfs_remove(mi->dbg_stats);
  85. -
  86. - debugfs_remove(mi->dbg_stats_csv);
  87. + debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
  88. + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
  89. + &minstrel_stat_csv_fops);
  90. }
  91. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
  92. ===================================================================
  93. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
  94. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
  95. @@ -1393,7 +1393,6 @@ static const struct rate_control_ops mac
  96. .free = minstrel_ht_free,
  97. #ifdef CPTCFG_MAC80211_DEBUGFS
  98. .add_sta_debugfs = minstrel_ht_add_sta_debugfs,
  99. - .remove_sta_debugfs = minstrel_ht_remove_sta_debugfs,
  100. #endif
  101. .get_expected_throughput = minstrel_ht_get_expected_throughput,
  102. };
  103. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
  104. ===================================================================
  105. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.h
  106. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
  107. @@ -110,17 +110,12 @@ struct minstrel_ht_sta_priv {
  108. struct minstrel_ht_sta ht;
  109. struct minstrel_sta_info legacy;
  110. };
  111. -#ifdef CPTCFG_MAC80211_DEBUGFS
  112. - struct dentry *dbg_stats;
  113. - struct dentry *dbg_stats_csv;
  114. -#endif
  115. void *ratelist;
  116. void *sample_table;
  117. bool is_ht;
  118. };
  119. void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
  120. -void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
  121. int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
  122. int prob_ewma);
  123. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
  124. ===================================================================
  125. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht_debugfs.c
  126. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
  127. @@ -303,17 +303,8 @@ minstrel_ht_add_sta_debugfs(void *priv,
  128. {
  129. struct minstrel_ht_sta_priv *msp = priv_sta;
  130. - msp->dbg_stats = debugfs_create_file("rc_stats", 0444, dir, msp,
  131. - &minstrel_ht_stat_fops);
  132. - msp->dbg_stats_csv = debugfs_create_file("rc_stats_csv", 0444, dir, msp,
  133. - &minstrel_ht_stat_csv_fops);
  134. -}
  135. -
  136. -void
  137. -minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta)
  138. -{
  139. - struct minstrel_ht_sta_priv *msp = priv_sta;
  140. -
  141. - debugfs_remove(msp->dbg_stats);
  142. - debugfs_remove(msp->dbg_stats_csv);
  143. + debugfs_create_file("rc_stats", S_IRUGO, dir, msp,
  144. + &minstrel_ht_stat_fops);
  145. + debugfs_create_file("rc_stats_csv", S_IRUGO, dir, msp,
  146. + &minstrel_ht_stat_csv_fops);
  147. }