2018-07-28 23:04:10

by John Whitmore

[permalink] [raw]
Subject: [PATCH 00/08] 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



2018-07-28 23:04:19

by John Whitmore

[permalink] [raw]
Subject: [PATCH 02/12] staging:rtl8192u: Rename ACI_AIFSN - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 6 +++---
drivers/staging/rtl8192u/r8192U_dm.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 92afa9dc9663..5856bf87c5dc 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index c4e4e3ba394b..04c08ca8a0bb 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -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);
--
2.18.0


2018-07-28 23:04:21

by John Whitmore

[permalink] [raw]
Subject: [PATCH 04/12] staging:rtl8192u: Remove unused union AC_PARAM - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 15 ---------------
1 file changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 901b85139d3b..43edb830ad5d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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.
--
2.18.0


2018-07-28 23:04:24

by John Whitmore

[permalink] [raw]
Subject: [PATCH 05/12] staging:rtl8192u: Remove unused union ECW -Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 12 ------------
1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 43edb830ad5d..65d7c9f4d840 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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.
--
2.18.0


2018-07-28 23:04:26

by John Whitmore

[permalink] [raw]
Subject: [PATCH 06/12] staging:rtl8192u: Rename enum DIRECTION_VALUE - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 4 ++--
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 65d7c9f4d840..428a8c4cebf1 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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;
+};


//
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 4b2da7f31166..79c96da41d8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -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");
--
2.18.0


2018-07-28 23:04:28

by John Whitmore

[permalink] [raw]
Subject: [PATCH 08/12] staging:rtl8192u: Remove unused constants - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 17b676b0ed8b..810d81addcf6 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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.
--
2.18.0


2018-07-28 23:04:33

by John Whitmore

[permalink] [raw]
Subject: [PATCH 07/12] staging:rtl8192u: Rename union QOS_TSINFO - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 6 +++---
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 428a8c4cebf1..17b676b0ed8b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 79c96da41d8b..4d92b97a1521 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -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):
--
2.18.0


2018-07-28 23:05:29

by John Whitmore

[permalink] [raw]
Subject: [PATCH 03/12] staging:rtl8192u: Rename member variables - Style

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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 10 +++++-----
drivers/staging/rtl8192u/r8192U_dm.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 5856bf87c5dc..901b85139d3b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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
};

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 04c08ca8a0bb..7dc912dd53af 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -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);
--
2.18.0


2018-07-28 23:06:27

by John Whitmore

[permalink] [raw]
Subject: [PATCH 01/12] 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.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index 8ee9370520f3..92afa9dc9663 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -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.
--
2.18.0


2018-07-28 23:08:42

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 00/08] staging:rtl8192u: cleanup of rtl819x_Qos.h - Style

On Sun, Jul 29, 2018 at 12:02:52AM +0100, John Whitmore wrote:
> 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
>

Sorry I forgot to edit the subject of each of the patch emails to
truncate the patch series to just the 8 that were good. I'll edit and
resend.

jwhitmore