diff mbox series

[v2,2/7] mac80211: Use debugfs_create_xul() helper

Message ID 20191025094130.26033-3-geert+renesas@glider.be (mailing list archive)
State Mainlined
Commit 0628cda318df6baec439ca6e6e274007492f1ccd
Headers show
Series debugfs: Add and use debugfs_create_xul() | expand

Commit Message

Geert Uytterhoeven Oct. 25, 2019, 9:41 a.m. UTC
Use the new debugfs_create_xul() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - No changes.
---
 net/mac80211/debugfs_sta.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

Comments

Johannes Berg Nov. 4, 2019, 7:28 a.m. UTC | #1
On Fri, 2019-10-25 at 11:41 +0200, Geert Uytterhoeven wrote:
> Use the new debugfs_create_xul() helper instead of open-coding the same
> operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Sorry Greg, this slipped through on my side.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

Do you prefer to take this to your tree still, or should I pick it up
later once debugfs_create_xul() is available (to me)?

johannes
Greg KH Nov. 4, 2019, 7:39 a.m. UTC | #2
On Mon, Nov 04, 2019 at 08:28:57AM +0100, Johannes Berg wrote:
> On Fri, 2019-10-25 at 11:41 +0200, Geert Uytterhoeven wrote:
> > Use the new debugfs_create_xul() helper instead of open-coding the same
> > operation.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Sorry Greg, this slipped through on my side.
> 
> Acked-by: Johannes Berg <johannes@sipsolutions.net>
> 
> Do you prefer to take this to your tree still, or should I pick it up
> later once debugfs_create_xul() is available (to me)?

I can take it now, thanks!

greg k-h
diff mbox series

Patch

diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index c8ad20c28c438dab..ca34dcdac8c0bd4d 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -928,12 +928,7 @@  STA_OPS(he_capa);
 		sta->debugfs_dir, sta, &sta_ ##name## _ops);
 
 #define DEBUGFS_ADD_COUNTER(name, field)				\
-	if (sizeof(sta->field) == sizeof(u32))				\
-		debugfs_create_u32(#name, 0400, sta->debugfs_dir,	\
-			(u32 *) &sta->field);				\
-	else								\
-		debugfs_create_u64(#name, 0400, sta->debugfs_dir,	\
-			(u64 *) &sta->field);
+	debugfs_create_ulong(#name, 0400, sta->debugfs_dir, &sta->field);
 
 void ieee80211_sta_debugfs_add(struct sta_info *sta)
 {
@@ -978,14 +973,8 @@  void ieee80211_sta_debugfs_add(struct sta_info *sta)
 				    NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
 		DEBUGFS_ADD(airtime);
 
-	if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
-		debugfs_create_x32("driver_buffered_tids", 0400,
-				   sta->debugfs_dir,
-				   (u32 *)&sta->driver_buffered_tids);
-	else
-		debugfs_create_x64("driver_buffered_tids", 0400,
-				   sta->debugfs_dir,
-				   (u64 *)&sta->driver_buffered_tids);
+	debugfs_create_xul("driver_buffered_tids", 0400, sta->debugfs_dir,
+			   &sta->driver_buffered_tids);
 
 	drv_sta_add_debugfs(local, sdata, &sta->sta, sta->debugfs_dir);
 }