Skip to contentSkip to conversation

staging:rtl8192u: Coding style changes

PATCH Superseded John Whitmore 2 participants 16 messages Jul 20, 2018 – Jul 21, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover staging:rtl8192u: Coding style changes

This is a collection of simple coding style chages to clear checkpatch issues in the file drivers/staging/rtl8192u/ieee80211/dot11d.h

John Whitmore (14):
staging:rtl8192u: Remove multiple blank lines - Style staging:rtl8192u: Remove typedef from structure - Style staging:rtl8192u: Rename structure member FirstChnl - Style staging:rtl8192u: Rename variable NumChnls - Style staging:rtl8192u: Rename variable MaxTxPowerInDbm - Style staging:rtl8192u: Remove typedef and rename DOT11D_STATE - Style staging:rtl8192u: Remove typedef and rename struct RT_DOT11D_INFO -
Style
staging:rtl8192u: Rename bEnabled > enabled - Style staging:rtl8192u: Rename CountryIeLen > country_ie_len - Style staging:rtl8192u: Rename CountryIeBuf > country_ie_buf - Style staging:rtl8192u: Rename CountryIeSrcAddr > country_ie_src_addr -
Style
staging:rtl8192u: Rename CountryIeWatchdog > country_ie_watchdog -
Style
staging:rtl8192u: Rename MaxTxPwrDbmList > max_tx_pwr_dbm_list - Style staging:rtl8192u: Rename variable State > state - Style

 drivers/staging/rtl8192u/ieee80211/dot11d.c   | 60 +++++++++----------
 drivers/staging/rtl8192u/ieee80211/dot11d.h   | 55 +++++++++--------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |  2 +-
 drivers/staging/rtl8192u/r8192U_core.c        |  2 +-
 4 files changed, 59 insertions(+), 60 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/14 staging:rtl8192u: Remove multiple blank lines - Style

Remove multiple blank lines which cause checkpatch issues. These are purely coding style changes which should not impact execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +0 -2
index 88bc298305bd..23ab2dae8347 100644
@@ -4,7 +4,6 @@
 
 #include "ieee80211.h"
 
-
 typedef struct _CHNL_TXPOWER_TRIPLE {
 	u8 FirstChnl;
 	u8  NumChnls;
@@ -59,7 +58,6 @@ typedef struct _RT_DOT11D_INFO {
 
 #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE)
 
-
 void
 Dot11d_Init(
 	struct ieee80211_device *dev
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/14 staging:rtl8192u: Remove typedef from structure - Style

In reply to John Whitmore

Remove the typedef directive from struct _CHNL_TXPOWER_TRIPLE. This is a coding style change which clears a checkpatch issue with declaring new types. There should be no impact on runtime execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +3 -3
index ba284bfb3b6d..8ac08ee5256e 100644
@@ -54,13 +54,13 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 {
 	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
 	u8 i, j, NumTriples, MaxChnlNum;
-	PCHNL_TXPOWER_TRIPLE pTriple;
+	struct chnl_txpower_triple *pTriple;
 
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
 	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
 	MaxChnlNum = 0;
 	NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */
-	pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
+	pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3);
 	for (i = 0; i < NumTriples; i++) {
 		if (MaxChnlNum >= pTriple->FirstChnl) {
 			/* It is not in a monotonically increasing order, so
@@ -83,7 +83,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 			MaxChnlNum = pTriple->FirstChnl + j;
 		}
 
-		pTriple = (PCHNL_TXPOWER_TRIPLE)((u8 *)pTriple + 3);
+		pTriple = (struct chnl_txpower_triple *)((u8 *)pTriple + 3);
 	}
 	netdev_info(dev->dev, "Channel List:");
 	for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
drivers/staging/rtl8192u/ieee80211/dot11d.h +2 -2
index 23ab2dae8347..9471279cf8e6 100644
@@ -4,11 +4,11 @@
 
 #include "ieee80211.h"
 
-typedef struct _CHNL_TXPOWER_TRIPLE {
+struct chnl_txpower_triple {
 	u8 FirstChnl;
 	u8  NumChnls;
 	u8  MaxTxPowerInDbm;
-} CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
+};
 
 typedef enum _DOT11D_STATE {
 	DOT11D_STATE_NONE = 0,
Signature · 1 line
2.18.0
#3 lore raw

PATCH 3/14 staging:rtl8192u: Rename structure member FirstChnl - Style

In reply to John Whitmore

Rename structure member FirstChnl to first_channel. This coding style change clears a checkpatch issue with CamelCase naming. This change should not impact the runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 10 +++++-----
 drivers/staging/rtl8192u/ieee80211/dot11d.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +5 -5
index 8ac08ee5256e..f24dae97bc0d 100644
@@ -62,14 +62,14 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 	NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */
 	pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3);
 	for (i = 0; i < NumTriples; i++) {
-		if (MaxChnlNum >= pTriple->FirstChnl) {
+		if (MaxChnlNum >= pTriple->first_channel) {
 			/* It is not in a monotonically increasing order, so
 			 * stop processing.
 			 */
 			netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
 			return;
 		}
-		if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) {
+		if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->NumChnls)) {
 			/* It is not a valid set of channel id, so stop
 			 * processing.
 			 */
@@ -78,9 +78,9 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 		}
 
 		for (j = 0; j < pTriple->NumChnls; j++) {
-			pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
-			pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = pTriple->MaxTxPowerInDbm;
-			MaxChnlNum = pTriple->FirstChnl + j;
+			pDot11dInfo->channel_map[pTriple->first_channel + j] = 1;
+			pDot11dInfo->MaxTxPwrDbmList[pTriple->first_channel + j] = pTriple->MaxTxPowerInDbm;
+			MaxChnlNum = pTriple->first_channel + j;
 		}
 
 		pTriple = (struct chnl_txpower_triple *)((u8 *)pTriple + 3);
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index 9471279cf8e6..968c622137df 100644
@@ -5,7 +5,7 @@
 #include "ieee80211.h"
 
 struct chnl_txpower_triple {
-	u8 FirstChnl;
+	u8  first_channel;
 	u8  NumChnls;
 	u8  MaxTxPowerInDbm;
 };
Signature · 1 line
2.18.0
#4 lore raw

PATCH 4/14 staging:rtl8192u: Rename variable NumChnls - Style

In reply to John Whitmore

Rename the member variable NumChnls to num_channels. This change clears the checkpatch issue with CamelCase naming. The change should not impact runtime execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 4 ++--
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +2 -2
index f24dae97bc0d..17bccb7bf594 100644
@@ -69,7 +69,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 			netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
 			return;
 		}
-		if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->NumChnls)) {
+		if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->num_channels)) {
 			/* It is not a valid set of channel id, so stop
 			 * processing.
 			 */
@@ -77,7 +77,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 			return;
 		}
 
-		for (j = 0; j < pTriple->NumChnls; j++) {
+		for (j = 0; j < pTriple->num_channels; j++) {
 			pDot11dInfo->channel_map[pTriple->first_channel + j] = 1;
 			pDot11dInfo->MaxTxPwrDbmList[pTriple->first_channel + j] = pTriple->MaxTxPowerInDbm;
 			MaxChnlNum = pTriple->first_channel + j;
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index 968c622137df..8c2b11d12185 100644
@@ -6,7 +6,7 @@
 
 struct chnl_txpower_triple {
 	u8  first_channel;
-	u8  NumChnls;
+	u8  num_channels;
 	u8  MaxTxPowerInDbm;
 };
 
Signature · 1 line
2.18.0
#5 lore raw

PATCH 5/14 staging:rtl8192u: Rename variable MaxTxPowerInDbm - Style

In reply to John Whitmore

Rename the variable MaxTxPowerInDbm to max_tx_pwr_dbm. This change clears a checkpatch issue with CamelCase naming. This coding style change should not impact runtime execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 2 +-
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +1 -1
index 17bccb7bf594..44b5e506b140 100644
@@ -79,7 +79,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 
 		for (j = 0; j < pTriple->num_channels; j++) {
 			pDot11dInfo->channel_map[pTriple->first_channel + j] = 1;
-			pDot11dInfo->MaxTxPwrDbmList[pTriple->first_channel + j] = pTriple->MaxTxPowerInDbm;
+			pDot11dInfo->MaxTxPwrDbmList[pTriple->first_channel + j] = pTriple->max_tx_pwr_dbm;
 			MaxChnlNum = pTriple->first_channel + j;
 		}
 
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index 8c2b11d12185..1b377faa53e0 100644
@@ -7,7 +7,7 @@
 struct chnl_txpower_triple {
 	u8  first_channel;
 	u8  num_channels;
-	u8  MaxTxPowerInDbm;
+	u8  max_tx_pwr_dbm;
 };
 
 typedef enum _DOT11D_STATE {
Signature · 1 line
2.18.0
#6 lore raw

PATCH 6/14 staging:rtl8192u: Remove typedef and rename DOT11D_STATE - Style

In reply to John Whitmore

Remove typedef from enumerated type DOT11D_STATE to clear checkpatch issue with declaring new types.

Rename the enumertion from DOT11D_STATE to dot11d_state.

These changes are coding style changes which should not effect runtime execution of code.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +3 -3
index 1b377faa53e0..9402c05cb24f 100644
@@ -10,11 +10,11 @@ struct chnl_txpower_triple {
 	u8  max_tx_pwr_dbm;
 };
 
-typedef enum _DOT11D_STATE {
+enum dot11d_state {
 	DOT11D_STATE_NONE = 0,
 	DOT11D_STATE_LEARNED,
 	DOT11D_STATE_DONE,
-} DOT11D_STATE;
+};
 
 typedef struct _RT_DOT11D_INFO {
 	/* DECLARE_RT_OBJECT(RT_DOT11D_INFO); */
@@ -29,7 +29,7 @@ typedef struct _RT_DOT11D_INFO {
 	u8  channel_map[MAX_CHANNEL_NUMBER+1];  /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
 	u8  MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
 
-	DOT11D_STATE State;
+	enum dot11d_state State;
 } RT_DOT11D_INFO, *PRT_DOT11D_INFO;
 #define eqMacAddr(a, b)		(((a)[0] == (b)[0] && \
 	(a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
Signature · 1 line
2.18.0
#7 lore raw

PATCH 7/14 staging:rtl8192u: Remove typedef and rename struct RT_DOT11D_INFO - Style

In reply to John Whitmore

Removed the typedef from structure RT_DOT11D_INFO. This change clears the checkpatch issue with declaring new types.

Rename the structure from RT_DOT11D_INFO to rt_dot11d_info.

Coding style changes which should not impact runtime execution of code.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c        | 14 +++++++-------
 drivers/staging/rtl8192u/ieee80211/dot11d.h        | 11 ++++++-----
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +7 -7
index 44b5e506b140..cd63e158c7c8 100644
@@ -5,7 +5,7 @@
 
 void Dot11d_Init(struct ieee80211_device *ieee)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
 
 	pDot11dInfo->bEnabled = false;
 
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(Dot11d_Init);
 void Dot11d_Reset(struct ieee80211_device *ieee)
 {
 	u32 i;
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
 	/* Clear old channel map */
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
 	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(Dot11d_Reset);
 void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 			    u16 CoutryIeLen, u8 *pCoutryIe)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 	u8 i, j, NumTriples, MaxChnlNum;
 	struct chnl_txpower_triple *pTriple;
 
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
 
 u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 	u8 MaxTxPwrInDbm = 255;
 
 	if (Channel > MAX_CHANNEL_NUMBER) {
@@ -117,7 +117,7 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
 
 void DOT11D_ScanComplete(struct ieee80211_device *dev)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 
 	switch (pDot11dInfo->State) {
 	case DOT11D_STATE_LEARNED:
@@ -138,7 +138,7 @@ EXPORT_SYMBOL(DOT11D_ScanComplete);
 
 int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 
 	if (channel > MAX_CHANNEL_NUMBER) {
 		netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
@@ -152,7 +152,7 @@ EXPORT_SYMBOL(IsLegalChannel);
 
 int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
-	PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
+	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 	u8 default_chn = 0;
 	u32 i = 0;
 
drivers/staging/rtl8192u/ieee80211/dot11d.h +6 -5
index 9402c05cb24f..8f7426333da5 100644
@@ -16,8 +16,8 @@ enum dot11d_state {
 	DOT11D_STATE_DONE,
 };
 
-typedef struct _RT_DOT11D_INFO {
-	/* DECLARE_RT_OBJECT(RT_DOT11D_INFO); */
+struct rt_dot11d_info {
+	/* DECLARE_RT_OBJECT(rt_dot11d_info); */
 
 	bool bEnabled; /* dot11MultiDomainCapabilityEnabled */
 
@@ -30,15 +30,16 @@ typedef struct _RT_DOT11D_INFO {
 	u8  MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
 
 	enum dot11d_state State;
-} RT_DOT11D_INFO, *PRT_DOT11D_INFO;
-#define eqMacAddr(a, b)		(((a)[0] == (b)[0] && \
+};
+
+#define eqMacAddr(a, b)		(((a)[0] == (b)[0] &&		    \
 	(a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \
 	(a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)
 #define cpMacAddr(des, src)	      ((des)[0] = (src)[0], \
 	(des)[1] = (src)[1], (des)[2] = (src)[2], \
 	(des)[3] = (src)[3], (des)[4] = (src)[4], \
 	(des)[5] = (src)[5])
-#define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo))
+#define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
 
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +1 -1
index 21874e78d8a1..590f2f2b3134 100644
@@ -2684,7 +2684,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	for(i = 0; i < 5; i++) {
 	  ieee->seq_ctrl[i] = 0;
 	}
-	ieee->pDot11dInfo = kzalloc(sizeof(RT_DOT11D_INFO), GFP_KERNEL);
+	ieee->pDot11dInfo = kzalloc(sizeof(struct rt_dot11d_info), GFP_KERNEL);
 	if (!ieee->pDot11dInfo)
 		IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n");
 	//added for  AP roaming
Signature · 1 line
2.18.0
maintainer
#8 lore raw

Re: [PATCH 07/14] staging:rtl8192u: Remove typedef and rename struct RT_DOT11D_INFO - Style

Quoted 5 lines · John Whitmore

Removed the typedef from structure RT_DOT11D_INFO. This change clears the checkpatch issue with declaring new types.

Rename the structure from RT_DOT11D_INFO to rt_dot11d_info.

Quoted 8 lines

Coding style changes which should not impact runtime execution of code.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c        | 14 +++++++-------
 drivers/staging/rtl8192u/ieee80211/dot11d.h        | 11 ++++++-----
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)

This patch fails to apply as well.

I've applied the series up to here. Please rebase what I didn't take from this, and the last patch from the other series, and resend.

thanks,

greg k-h

#9 lore raw

PATCH 8/14 staging:rtl8192u: Rename bEnabled > enabled - Style

In reply to John Whitmore

Rename the member variable bEnabled to enabled. This change clears the checkpatch issue with CamelCase. Purely a coding style change which should not impact runtime execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 2 +-
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 4 ++--
 drivers/staging/rtl8192u/r8192U_core.c      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +1 -1
index cd63e158c7c8..3d2eb19a7f48 100644
@@ -7,7 +7,7 @@ void Dot11d_Init(struct ieee80211_device *ieee)
 {
 	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
 
-	pDot11dInfo->bEnabled = false;
+	pDot11dInfo->enabled = false;
 
 	pDot11dInfo->State = DOT11D_STATE_NONE;
 	pDot11dInfo->CountryIeLen = 0;
drivers/staging/rtl8192u/ieee80211/dot11d.h +2 -2
index 8f7426333da5..cfe342d0b4bb 100644
@@ -19,7 +19,7 @@ enum dot11d_state {
 struct rt_dot11d_info {
 	/* DECLARE_RT_OBJECT(rt_dot11d_info); */
 
-	bool bEnabled; /* dot11MultiDomainCapabilityEnabled */
+	bool enabled; /* dot11MultiDomainCapabilityEnabled */
 
 	u16 CountryIeLen; /* > 0 if CountryIeBuf[] contains valid country information element. */
 	u8  CountryIeBuf[MAX_IE_LEN];
@@ -41,7 +41,7 @@ struct rt_dot11d_info {
 	(des)[5] = (src)[5])
 #define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
 
-#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
+#define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
 
 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 8b17400f6c13..038df372f4a8 100644
@@ -211,7 +211,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)
 		/* this flag enabled to follow 11d country IE setting,
 		 * otherwise, it shall follow global domain settings.
 		 */
-		GET_DOT11D_INFO(ieee)->bEnabled = 0;
+		GET_DOT11D_INFO(ieee)->enabled = 0;
 		Dot11d_Reset(ieee);
 		ieee->bGlobalDomain = true;
 		break;
Signature · 1 line
2.18.0
#10 lore raw

PATCH 9/14 staging:rtl8192u: Rename CountryIeLen > country_ie_len - Style

In reply to John Whitmore

Rename CountryIeLen to country_ie_len, coding style change to clear checkpatch issue with CamelCase naming. The change should have no impact on runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +3 -3
index 3d2eb19a7f48..87af2ddae349 100644
@@ -10,7 +10,7 @@ void Dot11d_Init(struct ieee80211_device *ieee)
 	pDot11dInfo->enabled = false;
 
 	pDot11dInfo->State = DOT11D_STATE_NONE;
-	pDot11dInfo->CountryIeLen = 0;
+	pDot11dInfo->country_ie_len = 0;
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
 	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
 	RESET_CIE_WATCHDOG(ieee);
@@ -35,7 +35,7 @@ void Dot11d_Reset(struct ieee80211_device *ieee)
 		(pDot11dInfo->channel_map)[i] = 2;
 
 	pDot11dInfo->State = DOT11D_STATE_NONE;
-	pDot11dInfo->CountryIeLen = 0;
+	pDot11dInfo->country_ie_len = 0;
 	RESET_CIE_WATCHDOG(ieee);
 }
 EXPORT_SYMBOL(Dot11d_Reset);
@@ -93,7 +93,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 
 	UPDATE_CIE_SRC(dev, pTaddr);
 
-	pDot11dInfo->CountryIeLen = CoutryIeLen;
+	pDot11dInfo->country_ie_len = CoutryIeLen;
 	memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe, CoutryIeLen);
 	pDot11dInfo->State = DOT11D_STATE_LEARNED;
 }
drivers/staging/rtl8192u/ieee80211/dot11d.h +3 -3
index cfe342d0b4bb..a15b21456101 100644
@@ -21,7 +21,7 @@ struct rt_dot11d_info {
 
 	bool enabled; /* dot11MultiDomainCapabilityEnabled */
 
-	u16 CountryIeLen; /* > 0 if CountryIeBuf[] contains valid country information element. */
+	u16 country_ie_len; /* > 0 if CountryIeBuf[] contains valid country information element. */
 	u8  CountryIeBuf[MAX_IE_LEN];
 	u8  CountryIeSrcAddr[6]; /* Source AP of the country IE. */
 	u8  CountryIeWatchdog;
@@ -42,13 +42,13 @@ struct rt_dot11d_info {
 #define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
 
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
-#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
+#define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
 
 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
 
 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
-	(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \
+	(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->country_ie_len) ? \
 	FALSE : \
 	(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
 
Signature · 1 line
2.18.0
#11 lore raw

PATCH 10/14 staging:rtl8192u: Rename CountryIeBuf > country_ie_buf - Style

In reply to John Whitmore

Rename variable CountryIeBuf to country_ie_buf, this clears the checkpatch issue with CamelCase naming. This change is a coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 2 +-
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +1 -1
index 87af2ddae349..b1205345a7e0 100644
@@ -94,7 +94,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 	UPDATE_CIE_SRC(dev, pTaddr);
 
 	pDot11dInfo->country_ie_len = CoutryIeLen;
-	memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe, CoutryIeLen);
+	memcpy(pDot11dInfo->country_ie_buf, pCoutryIe, CoutryIeLen);
 	pDot11dInfo->State = DOT11D_STATE_LEARNED;
 }
 EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
drivers/staging/rtl8192u/ieee80211/dot11d.h +3 -3
index a15b21456101..109b82e69b5e 100644
@@ -21,8 +21,8 @@ struct rt_dot11d_info {
 
 	bool enabled; /* dot11MultiDomainCapabilityEnabled */
 
-	u16 country_ie_len; /* > 0 if CountryIeBuf[] contains valid country information element. */
-	u8  CountryIeBuf[MAX_IE_LEN];
+	u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country information element. */
+	u8  country_ie_buf[MAX_IE_LEN];
 	u8  CountryIeSrcAddr[6]; /* Source AP of the country IE. */
 	u8  CountryIeWatchdog;
 
@@ -50,7 +50,7 @@ struct rt_dot11d_info {
 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
 	(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->country_ie_len) ? \
 	FALSE : \
-	(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length)))
+	(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->country_ie_buf, (__Ie).Octet, (__Ie).Length)))
 
 #define CIE_WATCHDOG_TH 1
 #define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
Signature · 1 line
2.18.0
#12 lore raw

PATCH 11/14 staging:rtl8192u: Rename CountryIeSrcAddr > country_ie_src_addr - Style

In reply to John Whitmore

Rename variable CountryIeSrcAddr to country_ie_src_addr, this change clears the checkpatch issue with CamelCase naming. This coding style change should not impact runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +3 -3
index 109b82e69b5e..e5087291d64a 100644
@@ -23,7 +23,7 @@ struct rt_dot11d_info {
 
 	u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country information element. */
 	u8  country_ie_buf[MAX_IE_LEN];
-	u8  CountryIeSrcAddr[6]; /* Source AP of the country IE. */
+	u8  country_ie_src_addr[6]; /* Source AP of the country IE. */
 	u8  CountryIeWatchdog;
 
 	u8  channel_map[MAX_CHANNEL_NUMBER+1];  /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
@@ -44,8 +44,8 @@ struct rt_dot11d_info {
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
 
-#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
-#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
+#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
 
 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \
 	(((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->country_ie_len) ? \
Signature · 1 line
2.18.0
#13 lore raw

PATCH 12/14 staging:rtl8192u: Rename CountryIeWatchdog > country_ie_watchdog - Style

In reply to John Whitmore

Rename the member variable CountryIeWatchdog to country_ie_watchdog, this change clears the checkpatch issue with CamelCase naming of variables. The change is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +2 -2
index e5087291d64a..a7fa1a7f01bd 100644
@@ -24,7 +24,7 @@ struct rt_dot11d_info {
 	u16 country_ie_len; /* > 0 if country_ie_buf[] contains valid country information element. */
 	u8  country_ie_buf[MAX_IE_LEN];
 	u8  country_ie_src_addr[6]; /* Source AP of the country IE. */
-	u8  CountryIeWatchdog;
+	u8  country_ie_watchdog;
 
 	u8  channel_map[MAX_CHANNEL_NUMBER+1];  /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
 	u8  MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
@@ -53,7 +53,7 @@ struct rt_dot11d_info {
 	(!memcmp(GET_DOT11D_INFO(__pIeeeDev)->country_ie_buf, (__Ie).Octet, (__Ie).Length)))
 
 #define CIE_WATCHDOG_TH 1
-#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
+#define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
 #define RESET_CIE_WATCHDOG(__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0)
 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
 
Signature · 1 line
2.18.0
#14 lore raw

PATCH 13/14 staging:rtl8192u: Rename MaxTxPwrDbmList > max_tx_pwr_dbm_list - Style

In reply to John Whitmore

Rename the member variable MaxTxPwrDbmList to max_tx_pwr_dbm_list. This change clears the checkpatch issue with CamelCase naming. The change is a simple coding style change which should not impact runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 10 +++++-----
 drivers/staging/rtl8192u/ieee80211/dot11d.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +5 -5
index b1205345a7e0..21912b2d728d 100644
@@ -12,7 +12,7 @@ void Dot11d_Init(struct ieee80211_device *ieee)
 	pDot11dInfo->State = DOT11D_STATE_NONE;
 	pDot11dInfo->country_ie_len = 0;
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
-	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
+	memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
 	RESET_CIE_WATCHDOG(ieee);
 
 	netdev_info(ieee->dev, "Dot11d_Init()\n");
@@ -26,7 +26,7 @@ void Dot11d_Reset(struct ieee80211_device *ieee)
 	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
 	/* Clear old channel map */
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
-	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
+	memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
 	/* Set new channel map */
 	for (i = 1; i <= 11; i++)
 		(pDot11dInfo->channel_map)[i] = 1;
@@ -57,7 +57,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 	struct chnl_txpower_triple *pTriple;
 
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
-	memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
+	memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
 	MaxChnlNum = 0;
 	NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */
 	pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3);
@@ -79,7 +79,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 
 		for (j = 0; j < pTriple->num_channels; j++) {
 			pDot11dInfo->channel_map[pTriple->first_channel + j] = 1;
-			pDot11dInfo->MaxTxPwrDbmList[pTriple->first_channel + j] = pTriple->max_tx_pwr_dbm;
+			pDot11dInfo->max_tx_pwr_dbm_list[pTriple->first_channel + j] = pTriple->max_tx_pwr_dbm;
 			MaxChnlNum = pTriple->first_channel + j;
 		}
 
@@ -109,7 +109,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
 		return MaxTxPwrInDbm;
 	}
 	if (pDot11dInfo->channel_map[Channel])
-		MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
+		MaxTxPwrInDbm = pDot11dInfo->max_tx_pwr_dbm_list[Channel];
 
 	return MaxTxPwrInDbm;
 }
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index a7fa1a7f01bd..0c7652a2ebb3 100644
@@ -27,7 +27,7 @@ struct rt_dot11d_info {
 	u8  country_ie_watchdog;
 
 	u8  channel_map[MAX_CHANNEL_NUMBER+1];  /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
-	u8  MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1];
+	u8  max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER+1];
 
 	enum dot11d_state State;
 };
Signature · 1 line
2.18.0
#15 lore raw

PATCH 14/14 staging:rtl8192u: Rename variable State > state - Style

In reply to John Whitmore

Rename the variable State to state, this clears the checkpatch issue with CamelCase naming. The change is purely coding style and should not impact runtime code execution.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c | 10 +++++-----
 drivers/staging/rtl8192u/ieee80211/dot11d.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +5 -5
index 21912b2d728d..2fb575a2b6ab 100644
@@ -9,7 +9,7 @@ void Dot11d_Init(struct ieee80211_device *ieee)
 
 	pDot11dInfo->enabled = false;
 
-	pDot11dInfo->State = DOT11D_STATE_NONE;
+	pDot11dInfo->state = DOT11D_STATE_NONE;
 	pDot11dInfo->country_ie_len = 0;
 	memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
 	memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
@@ -34,7 +34,7 @@ void Dot11d_Reset(struct ieee80211_device *ieee)
 	for (i = 12; i <= 14; i++)
 		(pDot11dInfo->channel_map)[i] = 2;
 
-	pDot11dInfo->State = DOT11D_STATE_NONE;
+	pDot11dInfo->state = DOT11D_STATE_NONE;
 	pDot11dInfo->country_ie_len = 0;
 	RESET_CIE_WATCHDOG(ieee);
 }
@@ -95,7 +95,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
 
 	pDot11dInfo->country_ie_len = CoutryIeLen;
 	memcpy(pDot11dInfo->country_ie_buf, pCoutryIe, CoutryIeLen);
-	pDot11dInfo->State = DOT11D_STATE_LEARNED;
+	pDot11dInfo->state = DOT11D_STATE_LEARNED;
 }
 EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
 
@@ -119,9 +119,9 @@ void DOT11D_ScanComplete(struct ieee80211_device *dev)
 {
 	struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
 
-	switch (pDot11dInfo->State) {
+	switch (pDot11dInfo->state) {
 	case DOT11D_STATE_LEARNED:
-		pDot11dInfo->State = DOT11D_STATE_DONE;
+		pDot11dInfo->state = DOT11D_STATE_DONE;
 		break;
 
 	case DOT11D_STATE_DONE:
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index 0c7652a2ebb3..5639bb498865 100644
@@ -29,7 +29,7 @@ struct rt_dot11d_info {
 	u8  channel_map[MAX_CHANNEL_NUMBER+1];  /* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */
 	u8  max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER+1];
 
-	enum dot11d_state State;
+	enum dot11d_state state;
 };
 
 #define eqMacAddr(a, b)		(((a)[0] == (b)[0] &&		    \
Signature · 1 line
2.18.0