Skip to contentSkip to conversation

staging: rtl8192u: ieee80211: Remove typedef to structure _bandwidth_autoswitch

PATCH In review sayli karnik 2 participants 2 messages Feb 25, 2017 – Feb 27, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: rtl8192u: ieee80211: Remove typedef to structure _bandwidth_autoswitch

Using typedef for a structure type is not suggested in Linux kernel coding style guidelines. So remove typedef from the _bandwidth_autoswitch structure. The typedef pointer pbandwidth_autoswitch is not used anywhere, so omit it. Also rename the structure to bandwidth_autoswitch since an underscore is normally prepended to indicate a hidden name, which is not the case here.

---
Changes in v2:
Renamed the structure from _bandwidth_autoswitch to bandwidth_autoswitch Changes in v3:
Changed spacing after 'long' to as it was before

 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +4 -5
index 176083e..c1fa229 100644
@@ -1461,13 +1461,12 @@ struct tx_pending {
 	struct ieee80211_txb *txb;
 };
 
-typedef struct _bandwidth_autoswitch {
+struct bandwidth_autoswitch {
 	long threshold_20Mhzto40Mhz;
-	long	threshold_40Mhzto20Mhz;
+	long	threshold_40Mhzto20Mhz;
 	bool bforced_tx20Mhz;
 	bool bautoswitch_enable;
-} bandwidth_autoswitch, *pbandwidth_autoswitch;
-
+};
 
 //added by amy for order
 
@@ -1873,7 +1872,7 @@ struct ieee80211_device {
 	Fsync_State			fsync_state;
 	bool		bis_any_nonbepkts;
 	//20Mhz 40Mhz AutoSwitch Threshold
-	bandwidth_autoswitch bandwidth_auto_switch;
+	struct bandwidth_autoswitch bandwidth_auto_switch;
 	//for txpower tracking
 	bool FwRWRF;
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 22 lines · sayli karnik

Using typedef for a structure type is not suggested in Linux kernel coding style guidelines. So remove typedef from the _bandwidth_autoswitch structure. The typedef pointer pbandwidth_autoswitch is not used anywhere, so omit it. Also rename the structure to bandwidth_autoswitch since an underscore is normally prepended to indicate a hidden name, which is not the case here.

---
Changes in v2:
Renamed the structure from _bandwidth_autoswitch to bandwidth_autoswitch Changes in v3:
Changed spacing after 'long' to as it was before

 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
index 176083e..c1fa229 100644

drivers/staging/rtl8192u/ieee80211/ieee80211.h struct tx_pending { · line 1466

Quoted 8 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -2
@@ -1461,13 +1461,12 @@ struct tx_pending {
 	struct ieee80211_txb *txb;
 };
 
-typedef struct _bandwidth_autoswitch {
+struct bandwidth_autoswitch {
 	long threshold_20Mhzto40Mhz;
-	long	threshold_40Mhzto20Mhz;
+	long	threshold_40Mhzto20Mhz;

Why are you still changing this line?

Please do not do that.

thanks,

greg k-h