Skip to contentSkip to conversation

staging: rtl8192e: cleanup coding style issues with spacing

PATCH In review Jerom van der Sar 3 participants 10 messages Oct 31, 2022 – Nov 8, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192e: cleanup coding style issues with spacing

Fixed several coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators. It passes without trivial warnings about spaces. Some other warnings still remain.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 25 +++++++++------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +11 -14
index 41faeb4b9b9b..aeef735679db 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
 {
 	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
 	rtl92e_writel(dev, RWCAM, ulcommand);
 }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
 		SECR_value |= SCR_TxUseDK;
 	}
 
-
 	ieee->hwsec_active = 1;
 	if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
 		ieee->hwsec_active = 0;
@@ -100,33 +99,32 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
 	}
 
 	if (DefaultKey)
-		usConfig |= BIT15 | (KeyType<<2);
+		usConfig |= BIT15 | (KeyType << 2);
 	else
-		usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
-
+		usConfig |= BIT15 | (KeyType << 2) | KeyIndex;
 
 	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
 		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
 		if (i == 0) {
-			TargetContent = (u32)(*(MacAddr+0)) << 16 |
-				(u32)(*(MacAddr+1)) << 24 |
+			TargetContent = (u32)(*(MacAddr + 0)) << 16 |
+				(u32)(*(MacAddr + 1)) << 24 |
 				(u32)usConfig;
 
 			rtl92e_writel(dev, WCAMI, TargetContent);
 			rtl92e_writel(dev, RWCAM, TargetCommand);
 		} else if (i == 1) {
-			TargetContent = (u32)(*(MacAddr+2)) |
-				(u32)(*(MacAddr+3)) <<  8 |
-				(u32)(*(MacAddr+4)) << 16 |
-				(u32)(*(MacAddr+5)) << 24;
+			TargetContent = (u32)(*(MacAddr + 2)) |
+				(u32)(*(MacAddr + 3)) <<  8 |
+				(u32)(*(MacAddr + 4)) << 16 |
+				(u32)(*(MacAddr + 5)) << 24;
 			rtl92e_writel(dev, WCAMI, TargetContent);
 			rtl92e_writel(dev, RWCAM, TargetCommand);
 		} else {
 			if (KeyContent != NULL) {
 				rtl92e_writel(dev, WCAMI,
-					      (u32)(*(KeyContent+i-2)));
+					      (u32)(*(KeyContent + i - 2)));
 				rtl92e_writel(dev, RWCAM, TargetCommand);
 				udelay(100);
 			}
@@ -152,7 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
 
 	if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
 	    (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
-
 		for (EntryId = 0; EntryId < 4; EntryId++) {
 			MacAddr = CAM_CONST_ADDR[EntryId];
 			if (priv->rtllib->swcamtable[EntryId].bused) {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 75 lines · Jerom van der Sar

Fixed several coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators. It passes without trivial warnings about spaces. Some other warnings still remain.

---
  drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 25 +++++++++------------
  1 file changed, 11 insertions(+), 14 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +11 -13
index 41faeb4b9b9b..aeef735679db 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
  {
  	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
  	rtl92e_writel(dev, RWCAM, ulcommand);
  }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
  		SECR_value |= SCR_TxUseDK;
  	}
 
-
  	ieee->hwsec_active = 1;
  	if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
  		ieee->hwsec_active = 0;
@@ -100,33 +99,32 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
  	}
 
  	if (DefaultKey)
-		usConfig |= BIT15 | (KeyType<<2);
+		usConfig |= BIT15 | (KeyType << 2);
  	else
-		usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
-
+		usConfig |= BIT15 | (KeyType << 2) | KeyIndex;
 
  	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
  		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
  		if (i == 0) {
-			TargetContent = (u32)(*(MacAddr+0)) << 16 |
-				(u32)(*(MacAddr+1)) << 24 |
+			TargetContent = (u32)(*(MacAddr + 0)) << 16 |
+				(u32)(*(MacAddr + 1)) << 24 |
  				(u32)usConfig;
 
  			rtl92e_writel(dev, WCAMI, TargetContent);
  			rtl92e_writel(dev, RWCAM, TargetCommand);
  		} else if (i == 1) {
-			TargetContent = (u32)(*(MacAddr+2)) |
-				(u32)(*(MacAddr+3)) <<  8 |
-				(u32)(*(MacAddr+4)) << 16 |
-				(u32)(*(MacAddr+5)) << 24;
+			TargetContent = (u32)(*(MacAddr + 2)) |
+				(u32)(*(MacAddr + 3)) <<  8 |
+				(u32)(*(MacAddr + 4)) << 16 |
+				(u32)(*(MacAddr + 5)) << 24;
  			rtl92e_writel(dev, WCAMI, TargetContent);
  			rtl92e_writel(dev, RWCAM, TargetCommand);
  		} else {
  			if (KeyContent != NULL) {
  				rtl92e_writel(dev, WCAMI,
-					      (u32)(*(KeyContent+i-2)));
+					      (u32)(*(KeyContent + i - 2)));
  				rtl92e_writel(dev, RWCAM, TargetCommand);
  				udelay(100);
  			}

drivers/staging/rtl8192e/rtl8192e/rtl_cam.c void rtl92e_cam_restore(struct net_device *dev) · line 155

Quoted 7 lines
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +0 -1
@@ -152,7 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
 
  	if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
  	    (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
-
  		for (EntryId = 0; EntryId < 4; EntryId++) {
  			MacAddr = CAM_CONST_ADDR[EntryId];
  			if (priv->rtllib->swcamtable[EntryId].bused) {

Text from greg k-h's patch email bot:

- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.

Comment PH: Try one simple patch first and then increase. Do not start with a series if you do not have any experience.

- You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like.

Bye Philipp

#2 lore raw

PATCH v2 1/1 staging: rtl8192e: space formatting fixes in rtl_cam.c

Fixed a few coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators. Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +2 -5
index 41faeb4b9b9b..d5aaf24a0ddb 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
 {
 	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
 	rtl92e_writel(dev, RWCAM, ulcommand);
 }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
 		SECR_value |= SCR_TxUseDK;
 	}
 
-
 	ieee->hwsec_active = 1;
 	if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
 		ieee->hwsec_active = 0;
@@ -104,10 +103,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
 	else
 		usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
 
-
 	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
 		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
 		if (i == 0) {
 			TargetContent = (u32)(*(MacAddr+0)) << 16 |
@@ -152,7 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
 
 	if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
 	    (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
-
 		for (EntryId = 0; EntryId < 4; EntryId++) {
 			MacAddr = CAM_CONST_ADDR[EntryId];
 			if (priv->rtllib->swcamtable[EntryId].bused) {
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v2] staging: rtl8192e: space formatting fixes in rtl_cam.c

Quoted 49 lines · Jerom van der Sar

Fixed a few coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators. Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

  drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +2 -4
index 41faeb4b9b9b..d5aaf24a0ddb 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
  {
  	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
  	rtl92e_writel(dev, RWCAM, ulcommand);
  }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
  		SECR_value |= SCR_TxUseDK;
  	}
 
-
  	ieee->hwsec_active = 1;
  	if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
  		ieee->hwsec_active = 0;
@@ -104,10 +103,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
  	else
  		usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
 
-
  	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
  		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
  		if (i == 0) {
  			TargetContent = (u32)(*(MacAddr+0)) << 16 |

drivers/staging/rtl8192e/rtl8192e/rtl_cam.c void rtl92e_cam_restore(struct net_device *dev) · line 155

Quoted 7 lines
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +0 -1
@@ -152,7 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
 
  	if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
  	    (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
-
  		for (EntryId = 0; EntryId < 4; EntryId++) {
  			MacAddr = CAM_CONST_ADDR[EntryId];
  			if (priv->rtllib->swcamtable[EntryId].bused) {

WARNING: Unexpected content after email: 'Jerom van der Sar <[email protected]>.', should be: 'Jerom van der Sar <[email protected]>' #14:

I cannot apply your patch.

Bye Philipp

#5 lore raw

PATCH v3 1/1 staging: rtl8192e: space formatting fixes in rtl_cam.c

In reply to Philipp Hortmann

Fixed a few coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators.Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v3:
- Fixed faulty dot at the end of the patch sign-off.

Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +2 -5
index 41faeb4b9b9b..d5aaf24a0ddb 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
 {
 	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
 	rtl92e_writel(dev, RWCAM, ulcommand);
 }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
 		SECR_value |= SCR_TxUseDK;
 	}
 
-
 	ieee->hwsec_active = 1;
 	if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
 		ieee->hwsec_active = 0;
@@ -104,10 +103,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
 	else
 		usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
 
-
 	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
 		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
 		if (i == 0) {
 			TargetContent = (u32)(*(MacAddr+0)) << 16 |
@@ -152,7 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
 
 	if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
 	    (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
-
 		for (EntryId = 0; EntryId < 4; EntryId++) {
 			MacAddr = CAM_CONST_ADDR[EntryId];
 			if (priv->rtllib->swcamtable[EntryId].bused) {
Signature · 1 line
2.34.1
maintainer
#6 lore raw

Re: [PATCH v3] staging: rtl8192e: space formatting fixes in rtl_cam.c

Quoted 23 lines · Jerom van der Sar

Fixed a few coding style issues in rtl_cam.c such as double blank lines and lack of spaces around binary operators.Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v3:
- Fixed faulty dot at the end of the patch sign-off.

Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +0 -0
index 41faeb4b9b9b..d5aaf24a0ddb 100644

drivers/staging/rtl8192e/rtl8192e/rtl_cam.c void rtl92e_cam_reset(struct net_device *dev) · line 20

Quoted 5 lines
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +1 -1
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
 {
 	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;

Ok, new spaces, nice!

drivers/staging/rtl8192e/rtl8192e/rtl_cam.c void rtl92e_enable_hw_security_config(struct net_device *dev) · line 43

Quoted 8 lines
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +0 -1
 	rtl92e_writel(dev, RWCAM, ulcommand);
 }
 
@@ -40,7 +40,6 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
 		SECR_value |= SCR_TxUseDK;
 	}
 
-

You removed a line?

That's a different type of fix, sorry. Please break this up into a "one logical change per patch" patch series and resend.

thanks,

greg k-h

#7 lore raw

PATCH v4 1/1 staging: rtl8192e: space formatting fixes in rtl_cam.c

Fixed a few coding style issues in rtl_cam.c: two times lack of spaces around binary operators. Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v4:
- Reverted more double blank line formatting fixes to make the patch even smaller.

Changes in v3:
- Fixed faulty dot at the end of the patch sign-off.

Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +2 -2
index 41faeb4b9b9b..41bff46d1b3a 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
 {
 	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
 	rtl92e_writel(dev, RWCAM, ulcommand);
 }
 
@@ -107,7 +107,7 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
 
 	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
 		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
 		if (i == 0) {
 			TargetContent = (u32)(*(MacAddr+0)) << 16 |
Signature · 1 line
2.34.1
#8 lore raw

Re: [PATCH v4] staging: rtl8192e: space formatting fixes in rtl_cam.c

Quoted 36 lines · Jerom van der Sar

Fixed a few coding style issues in rtl_cam.c: two times lack of spaces around binary operators. Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v4:
- Reverted more double blank line formatting fixes to make the patch even smaller.

Changes in v3:
- Fixed faulty dot at the end of the patch sign-off.

Changes in v2:
- Reverted some formatting fixes to make the diff easier to review.

  drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +1 -1
index 41faeb4b9b9b..41bff46d1b3a 100644
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
  {
  	u32 ulcommand = 0;
 
-	ulcommand |= BIT31|BIT30;
+	ulcommand |= BIT31 | BIT30;
  	rtl92e_writel(dev, RWCAM, ulcommand);
  }
 

drivers/staging/rtl8192e/rtl8192e/rtl_cam.c void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, · line 113

Quoted 8 lines
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +1 -1
@@ -107,7 +107,7 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
 
  	for (i = 0; i < CAM_CONTENT_COUNT; i++) {
  		TargetCommand  = i + CAM_CONTENT_COUNT * EntryNo;
-		TargetCommand |= BIT31|BIT16;
+		TargetCommand |= BIT31 | BIT16;
 
  		if (i == 0) {
  			TargetContent = (u32)(*(MacAddr+0)) << 16 |

Please rebase. I cannot apply your patch.

Bye Philipp

maintainer
#9 lore raw

Re: [PATCH v4] staging: rtl8192e: space formatting fixes in rtl_cam.c

In reply to Jerom van der Sar
Quoted 4 lines · Jerom van der Sar

Fixed a few coding style issues in rtl_cam.c: two times lack of spaces around binary operators. Some other warnings still remain. These issues were found by scripts/checkpatch.pl.

Quoted 8 lines

This patch helps clean up the rtl8192e driver in staging, making it easier to read and maintain.

---
Changes in v4:
- Reverted more double blank line formatting fixes to make the patch even smaller.

Does not apply to my tree :(