All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] iwlegacy: 3945: no need to check return value of debugfs_create functions
@ 2019-06-12 14:26 Greg Kroah-Hartman
  2019-06-12 14:26 ` [PATCH 2/5] iwlegacy: 4965: " Greg Kroah-Hartman
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2019-06-12 14:26 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Greg Kroah-Hartman, Stanislaw Gruszka, Kalle Valo,
	David S. Miller, linux-wireless, netdev

When calling debugfs functions, there is no need to ever check the
return value.  This driver was saving the debugfs file away to be
removed at a later time.  However, the 80211 core would delete the whole
directory that the debugfs files are created in, after it asks the
driver to do the deletion, so just rely on the 80211 core to do all of
the cleanup for us, making us not need to keep a pointer to the dentries
around at all.

This cleans up the structure of the driver data a bit and makes the code
a tiny bit smaller.

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/intel/iwlegacy/3945-rs.c | 14 ++------------
 drivers/net/wireless/intel/iwlegacy/3945.h    |  3 ---
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/3945-rs.c b/drivers/net/wireless/intel/iwlegacy/3945-rs.c
index a697edd46e7f..1d810cae6091 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-rs.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-rs.c
@@ -861,17 +861,8 @@ il3945_add_debugfs(void *il, void *il_sta, struct dentry *dir)
 {
 	struct il3945_rs_sta *lq_sta = il_sta;
 
-	lq_sta->rs_sta_dbgfs_stats_table_file =
-	    debugfs_create_file("rate_stats_table", 0600, dir, lq_sta,
-				&rs_sta_dbgfs_stats_table_ops);
-
-}
-
-static void
-il3945_remove_debugfs(void *il, void *il_sta)
-{
-	struct il3945_rs_sta *lq_sta = il_sta;
-	debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file);
+	debugfs_create_file("rate_stats_table", 0600, dir, lq_sta,
+			    &rs_sta_dbgfs_stats_table_ops);
 }
 #endif
 
@@ -898,7 +889,6 @@ static const struct rate_control_ops rs_ops = {
 	.free_sta = il3945_rs_free_sta,
 #ifdef CONFIG_MAC80211_DEBUGFS
 	.add_sta_debugfs = il3945_add_debugfs,
-	.remove_sta_debugfs = il3945_remove_debugfs,
 #endif
 
 };
diff --git a/drivers/net/wireless/intel/iwlegacy/3945.h b/drivers/net/wireless/intel/iwlegacy/3945.h
index 00030d43a194..1aeb4b238fcf 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945.h
+++ b/drivers/net/wireless/intel/iwlegacy/3945.h
@@ -87,9 +87,6 @@ struct il3945_rs_sta {
 	u8 start_rate;
 	struct timer_list rate_scale_flush;
 	struct il3945_rate_scale_data win[RATE_COUNT_3945];
-#ifdef CONFIG_MAC80211_DEBUGFS
-	struct dentry *rs_sta_dbgfs_stats_table_file;
-#endif
 
 	/* used to be in sta_info */
 	int last_txrate_idx;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-05  8:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 14:26 [PATCH 1/5] iwlegacy: 3945: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-12 14:26 ` [PATCH 2/5] iwlegacy: 4965: " Greg Kroah-Hartman
2019-06-12 14:26 ` [PATCH 3/5] iwlwifi: dvm: " Greg Kroah-Hartman
2019-07-05  8:37   ` Luciano Coelho
2019-06-12 14:26 ` [PATCH 4/5] iwlwifi: mvm: remove unused .remove_sta_debugfs callback Greg Kroah-Hartman
2019-07-05  8:38   ` Luciano Coelho
2019-06-12 14:26 ` [PATCH 5/5] mac80211: remove unused and unneeded remove_sta_debugfs callback Greg Kroah-Hartman
2019-06-25  5:08 ` [PATCH 1/5] iwlegacy: 3945: no need to check return value of debugfs_create functions Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.