Skip to contentSkip to conversation

staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

PATCH Superseded John Whitmore 1 participant 9 messages Jul 28, 2018 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

These are a few coding style changes to the file drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
I had more patches in the list but had to dump some of the later patches as I made a mistake. Thought I'd send these 8.

John Whitmore (8):
staging:rtl8192u: Add spaces around operators - Style staging:rtl8192u: Rename ACI_AIFSN - Style staging:rtl8192u: Rename member variables - Style staging:rtl8192u: Remove unused union AC_PARAM - Style staging:rtl8192u: Remove unused union ECW -Style staging:rtl8192u: Rename enum DIRECTION_VALUE - Style staging:rtl8192u: Rename union QOS_TSINFO - Style staging:rtl8192u: Remove unused constants - Style

#1 lore raw

PATCH v2 1/8 staging:rtl8192u: Add spaces around operators - Style

Add the required spaces around '+' and '*' operators. This is a coding style change to clear the checkpatch issue. There should be no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +1 -1
index 8ee9370520f3..92afa9dc9663 100644
@@ -7,7 +7,7 @@
 #define AC_PARAM_SIZE	4
 #define WMM_PARAM_ELE_BODY_LEN	18
 
-#define WMM_PARAM_ELEMENT_SIZE	(8+(4*AC_PARAM_SIZE))
+#define WMM_PARAM_ELEMENT_SIZE	(8 + (4 * AC_PARAM_SIZE))
 
 //
 // ACI/AIFSN Field.
Signature · 1 line
2.18.0
#2 lore raw

PATCH v2 2/8 staging:rtl8192u: Rename ACI_AIFSN - Style

In reply to John Whitmore

Rename the union ACI_AIFSN to aci_aifsn and remove the typedef directive.

The removal of the typedef clears the checkpatch issue with defining new types. The renaming is to adhere to the coding style where types are name in lower case.

These changes are coding style changes which should have no impact on runtime execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 6 +++---
 drivers/staging/rtl8192u/r8192U_dm.c             | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +3 -3
index 92afa9dc9663..5856bf87c5dc 100644
@@ -13,7 +13,7 @@
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
-typedef	union _ACI_AIFSN {
+union aci_aifsn {
 	u8	charData;
 
 	struct {
@@ -22,7 +22,7 @@ typedef	union _ACI_AIFSN {
 		u8	ACI:2;
 		u8	Reserved:1;
 	} f;	// Field
-} ACI_AIFSN, *PACI_AIFSN;
+};
 
 //
 // ECWmin/ECWmax field.
@@ -45,7 +45,7 @@ typedef	union _AC_PARAM {
 	u8	charData[4];
 
 	struct {
-		ACI_AIFSN	AciAifsn;
+		union aci_aifsn	AciAifsn;
 		ECW		Ecw;
 		u16		TXOPLimit;
 	} f;	// Field
drivers/staging/rtl8192u/r8192U_dm.c +1 -1
index c4e4e3ba394b..04c08ca8a0bb 100644
@@ -2333,7 +2333,7 @@ static void dm_check_edca_turbo(
 			{
 				/*  TODO:  Modified this part and try to set acm control in only 1 IO processing!! */
 
-				PACI_AIFSN	pAciAifsn = (PACI_AIFSN)&(qos_parameters->aifs[0]);
+				union aci_aifsn *pAciAifsn = (union aci_aifsn *)&(qos_parameters->aifs[0]);
 				u8		AcmCtrl;
 
 				read_nic_byte(dev, AcmHwCtrl, &AcmCtrl);
Signature · 1 line
2.18.0
#3 lore raw

PATCH v2 3/8 staging:rtl8192u: Rename member variables - Style

In reply to John Whitmore

Rename the member variables of union aci_aifsn, which should be named in lowercase. The only member variable, of this union, which is actually used is 'acm'.

This are coding style changes which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 10 +++++-----
 drivers/staging/rtl8192u/r8192U_dm.c             |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +5 -5
index 5856bf87c5dc..901b85139d3b 100644
@@ -14,13 +14,13 @@
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
 //
 union aci_aifsn {
-	u8	charData;
+	u8	char_data;
 
 	struct {
-		u8	AIFSN:4;
-		u8	ACM:1;
-		u8	ACI:2;
-		u8	Reserved:1;
+		u8	aifsn:4;
+		u8	acm:1;
+		u8	aci:2;
+		u8	reserved:1;
 	} f;	// Field
 };
 
drivers/staging/rtl8192u/r8192U_dm.c +1 -1
index 04c08ca8a0bb..7dc912dd53af 100644
@@ -2338,7 +2338,7 @@ static void dm_check_edca_turbo(
 
 				read_nic_byte(dev, AcmHwCtrl, &AcmCtrl);
 
-				if (pAciAifsn->f.ACM) { /*  ACM bit is 1. */
+				if (pAciAifsn->f.acm) { /*  acm bit is 1. */
 					AcmCtrl |= AcmHw_BeqEn;
 				} else {	/* ACM bit is 0. */
 					AcmCtrl &= (~AcmHw_BeqEn);
Signature · 1 line
2.18.0
#4 lore raw

PATCH v2 4/8 staging:rtl8192u: Remove unused union AC_PARAM - Style

In reply to John Whitmore

The union ACM_PARAM is never actually used in code so removed. This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +0 -15
index 901b85139d3b..43edb830ad5d 100644
@@ -36,21 +36,6 @@ typedef	union _ECW {
 	} f;	// Field
 } ECW, *PECW;
 
-//
-// AC Parameters Record Format.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
-//
-typedef	union _AC_PARAM {
-	u32	longData;
-	u8	charData[4];
-
-	struct {
-		union aci_aifsn	AciAifsn;
-		ECW		Ecw;
-		u16		TXOPLimit;
-	} f;	// Field
-} AC_PARAM, *PAC_PARAM;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
Signature · 1 line
2.18.0
#5 lore raw

PATCH v2 5/8 staging:rtl8192u: Remove unused union ECW -Style

In reply to John Whitmore

The union ECW is never used in code so has simply been removed. This is a coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 12 ------------
 1 file changed, 12 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +0 -12
index 43edb830ad5d..65d7c9f4d840 100644
@@ -24,18 +24,6 @@ union aci_aifsn {
 	} f;	// Field
 };
 
-//
-// ECWmin/ECWmax field.
-// Ref: WMM spec 2.2.2: WME Parameter Element, p.13.
-//
-typedef	union _ECW {
-	u8	charData;
-	struct {
-		u8	ECWmin:4;
-		u8	ECWmax:4;
-	} f;	// Field
-} ECW, *PECW;
-
 //
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
Signature · 1 line
2.18.0
#6 lore raw

PATCH v2 6/8 staging:rtl8192u: Rename enum DIRECTION_VALUE - Style

In reply to John Whitmore

The enumerated type DIRECTION_VALUE should be named in lowercase to comply with coding standard so is renamed to direction_value. In addition the 'typedef' directive has been removed to clear the checkpatch issue with defining new types.

These changes are coding style changes which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h    | 4 ++--
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +2 -2
index 65d7c9f4d840..428a8c4cebf1 100644
@@ -28,12 +28,12 @@ union aci_aifsn {
 // Direction Field Values.
 // Ref: WMM spec 2.2.11: WME TSPEC Element, p.18.
 //
-typedef	enum _DIRECTION_VALUE {
+enum direction_value {
 	DIR_UP			= 0,		// 0x00	// UpLink
 	DIR_DOWN		= 1,		// 0x01	// DownLink
 	DIR_DIRECT		= 2,		// 0x10	// DirectLink
 	DIR_BI_DIR		= 3,		// 0x11	// Bi-Direction
-} DIRECTION_VALUE, *PDIRECTION_VALUE;
+};
 
 
 //
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +1 -1
index 4b2da7f31166..79c96da41d8b 100644
@@ -366,7 +366,7 @@ bool GetTs(
 								(&ieee->Tx_TS_Admit_List):
 								(&ieee->Rx_TS_Admit_List);
 
-			DIRECTION_VALUE		Dir =		(ieee->iw_mode == IW_MODE_MASTER)?
+			enum direction_value	Dir =		(ieee->iw_mode == IW_MODE_MASTER)?
 								((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP):
 								((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN);
 			IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n");
Signature · 1 line
2.18.0
#7 lore raw

PATCH v2 7/8 staging:rtl8192u: Rename union QOS_TSINFO - Style

In reply to John Whitmore

The union QOS_TSINFO, as a type, should have a lowercase name. The union has therefore been renamed to qos_tsinfo. Additionally the 'typedef' directive has been removed to clear the checkpatch issue with defining new types.

These are coding style changes which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h    | 6 +++---
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +3 -3
index 428a8c4cebf1..17b676b0ed8b 100644
@@ -42,7 +42,7 @@ enum direction_value {
 //	1. WMM spec 2.2.11: WME TSPEC Element, p.18.
 //	2. 8185 QoS code: QOS_TSINFO [def. in QoS_mp.h]
 //
-typedef union _QOS_TSINFO {
+union qos_tsinfo {
 	u8		charData[3];
 	struct {
 		u8		ucTrafficType:1;			//WMM is reserved
@@ -56,7 +56,7 @@ typedef union _QOS_TSINFO {
 		u8		ucSchedule:1;			//WMM is reserved
 		u8		ucReserved:7;
 	} field;
-} QOS_TSINFO, *PQOS_TSINFO;
+};
 
 //
 // WMM TSPEC Body.
@@ -66,7 +66,7 @@ typedef union _TSPEC_BODY {
 	u8		charData[55];
 
 	struct {
-		QOS_TSINFO	TSInfo;	//u8	TSInfo[3];
+		union qos_tsinfo	TSInfo;	//u8	TSInfo[3];
 		u16	NominalMSDUsize;
 		u16	MaxMSDUsize;
 		u32	MinServiceItv;
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +1 -1
index 79c96da41d8b..4d92b97a1521 100644
@@ -355,7 +355,7 @@ bool GetTs(
 			// For HCCA or WMMSA, TS cannot be addmit without negotiation.
 			//
 			TSPEC_BODY	TSpec;
-			PQOS_TSINFO		pTSInfo = &TSpec.f.TSInfo;
+			union qos_tsinfo	*pTSInfo = &TSpec.f.TSInfo;
 			struct list_head	*pUnusedList =
 								(TxRxSelect == TX_DIR)?
 								(&ieee->Tx_TS_Unused_List):
Signature · 1 line
2.18.0
#8 lore raw

PATCH v2 8/8 staging:rtl8192u: Remove unused constants - Style

In reply to John Whitmore

Remove defined constants from code, since they are never actually used in code. This is a simple coding style change which should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 7 -------
 1 file changed, 7 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +0 -7
index 17b676b0ed8b..810d81addcf6 100644
@@ -2,13 +2,6 @@
 #ifndef __INC_QOS_TYPE_H
 #define __INC_QOS_TYPE_H
 
-#define	MAX_WMMELE_LENGTH	64
-
-#define AC_PARAM_SIZE	4
-#define WMM_PARAM_ELE_BODY_LEN	18
-
-#define WMM_PARAM_ELEMENT_SIZE	(8 + (4 * AC_PARAM_SIZE))
-
 //
 // ACI/AIFSN Field.
 // Ref: WMM spec 2.2.2: WME Parameter Element, p.12.
Signature · 1 line
2.18.0