staging:rtl8192u: cleanup of rtl819x_Qos.h - Style
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
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
@@ -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
PATCH v2 2/8 staging:rtl8192u: Rename ACI_AIFSN - Style
In reply to John WhitmoreRename 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
@@ -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
@@ -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
PATCH v2 3/8 staging:rtl8192u: Rename member variables - Style
In reply to John WhitmoreRename 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
@@ -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
@@ -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
PATCH v2 4/8 staging:rtl8192u: Remove unused union AC_PARAM - Style
In reply to John WhitmoreThe 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
@@ -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
PATCH v2 5/8 staging:rtl8192u: Remove unused union ECW -Style
In reply to John WhitmoreThe 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
@@ -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
PATCH v2 6/8 staging:rtl8192u: Rename enum DIRECTION_VALUE - Style
In reply to John WhitmoreThe 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
@@ -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
@@ -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
PATCH v2 7/8 staging:rtl8192u: Rename union QOS_TSINFO - Style
In reply to John WhitmoreThe 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
@@ -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
@@ -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
PATCH v2 8/8 staging:rtl8192u: Remove unused constants - Style
In reply to John WhitmoreRemove 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
@@ -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