Skip to contentSkip to conversation

staging: rtl8192e: code cleanup patches

PATCH RESEND Superseded Khadija Kamran 4 participants 12 messages Mar 23, 2023 Staging

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover staging: rtl8192e: code cleanup patches

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Khadija Kamran (4):
staging: rtl8192e: remove extra blank lines
staging: rtl8192e: add blank lines after declarations
staging: rtl8192e: add spaces around binary operators
staging: rtl8192e: remove blank lines after '{'

 drivers/staging/rtl8192e/rtllib_rx.c | 73 +++++++++++-----------------
 1 file changed, 29 insertions(+), 44 deletions(-)

--
2.34.1

#1 lore raw

PATCH RESEND 1/4 staging: rtl8192e: remove extra blank lines

Remove extra blank lines as reported by checkpatch.pl

"CHECK: Please don't use multiple blank lines"

---
 drivers/staging/rtl8192e/rtllib_rx.c | 13 -------------
 1 file changed, 13 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +0 -13
index c394c21beefb..c6114d99829b 100644
@@ -154,7 +154,6 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
 	return skb;
 }
 
-
 /* Called only as a tasklet (software IRQ) */
 static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
 					   struct rtllib_hdr_4addr *hdr)
@@ -318,7 +317,6 @@ rtllib_rx_frame_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
 	return res;
 }
 
-
 /* Called only as a tasklet (software IRQ), by rtllib_rx */
 static inline int
 rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
@@ -355,7 +353,6 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
 	return 0;
 }
 
-
 /* this function is stolen from ipw2200 driver*/
 #define IEEE_PACKET_RETRY_TIME (5*HZ)
 static int is_duplicate_packet(struct rtllib_device *ieee,
@@ -887,7 +884,6 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
 	return rxb->nr_subframes;
 }
 
-
 static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
 				   struct sk_buff *skb,
 				   struct rtllib_rx_stats *rx_stats)
@@ -1569,7 +1565,6 @@ static int rtllib_verify_qos_info(struct rtllib_qos_information_element
 	return 0;
 }
 
-
 /* Parse a QoS parameter element */
 static int rtllib_read_qos_param_element(
 			struct rtllib_qos_parameter_info *element_param,
@@ -1599,7 +1594,6 @@ static int rtllib_read_qos_info_element(
 	return rtllib_verify_qos_info(element_info, QOS_OUI_INFO_SUB_TYPE);
 }
 
-
 /* Write QoS parameters from the ac parameters. */
 static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info *param_elm,
 					       struct rtllib_qos_data *qos_data)
@@ -1843,7 +1837,6 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
 		}
 	}
 
-
 	if (*tmp_htinfo_len == 0) {
 		if (info_element->len >= 4 &&
 		    info_element->data[0] == 0x00 &&
@@ -1932,7 +1925,6 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
 	    info_element->data[2] == 0x96)
 		network->cisco_cap_exist = true;
 
-
 	if (info_element->len >= 3 &&
 	    info_element->data[0] == 0x00 &&
 	    info_element->data[1] == 0x0a &&
@@ -2142,13 +2134,11 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 
 			network->dtim_data = RTLLIB_DTIM_VALID;
 
-
 			if (info_element->data[2] & 1)
 				network->dtim_data |= RTLLIB_DTIM_MBCAST;
 
 			offset = (info_element->data[2] >> 1)*2;
 
-
 			if (ieee->assoc_id < 8*offset ||
 			    ieee->assoc_id > 8*(offset + info_element->len - 3))
 				break;
@@ -2203,7 +2193,6 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 						 &tmp_htcap_len);
 			break;
 
-
 		case MFIE_TYPE_HT_INFO:
 			netdev_dbg(ieee->dev, "MFIE_TYPE_HT_INFO: %d bytes\n",
 				   info_element->len);
@@ -2392,7 +2381,6 @@ static inline int is_same_network(struct rtllib_network *src,
 		(dst->capability & WLAN_CAPABILITY_ESS)));
 }
 
-
 static inline void update_network(struct rtllib_device *ieee,
 				  struct rtllib_network *dst,
 				  struct rtllib_network *src)
@@ -2580,7 +2568,6 @@ static inline void rtllib_process_probe_response(
 		goto free_network;
 	}
 
-
 	if (!rtllib_legal_channel(ieee, network->channel))
 		goto free_network;
 

--
2.34.1

#2 lore raw

PATCH RESEND 2/4 staging: rtl8192e: add blank lines after declarations

In reply to Khadija Kamran

Add blank lines after declarations as reported by checkpatch.pl

"CHECK: Please use a blank line after function/struct/union/enum declarations"

---
 drivers/staging/rtl8192e/rtllib_rx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8192e/rtllib_rx.c +2 -0
index c6114d99829b..7144a0630ea6 100644
@@ -231,10 +231,12 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
 static unsigned char rfc1042_header[] = {
 	0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
 };
+
 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
 static unsigned char bridge_tunnel_header[] = {
 	0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
 };
+
 /* No encapsulation header if EtherType < 0x600 (=length) */
 
 /* Called by rtllib_rx_frame_decrypt */

--
2.34.1

#3 lore raw

PATCH RESEND 3/4 staging: rtl8192e: add spaces around binary operators

In reply to Khadija Kamran

Use spaces around binary operators as suggested by Linux kernel coding style.
Issues reported by checkpatch.pl for the following binary operators:
+ , - , * , | , <<

---
 drivers/staging/rtl8192e/rtllib_rx.c | 54 ++++++++++++++--------------
 1 file changed, 27 insertions(+), 27 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +27 -27
index 7144a0630ea6..f627dfe66d90 100644
@@ -356,7 +356,7 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
 }
 
 /* this function is stolen from ipw2200 driver*/
-#define IEEE_PACKET_RETRY_TIME (5*HZ)
+#define IEEE_PACKET_RETRY_TIME (5 * HZ)
 static int is_duplicate_packet(struct rtllib_device *ieee,
 				      struct rtllib_hdr_4addr *header)
 {
@@ -936,7 +936,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
 
 		if (GetTs(ieee, (struct ts_common_info **)&pRxTS, hdr->addr2,
 			(u8)Frame_QoSTID((u8 *)(skb->data)), RX_DIR, true)) {
-			if ((fc & (1<<11)) && (frag == pRxTS->rx_last_frag_num) &&
+			if ((fc & (1 << 11)) && (frag == pRxTS->rx_last_frag_num) &&
 			    (WLAN_GET_SEQ_SEQ(sc) == pRxTS->rx_last_seq_num))
 				return -1;
 			pRxTS->rx_last_frag_num = frag;
@@ -1619,23 +1619,23 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info
 		case 1:
 			/* BIT(0) | BIT(3) */
 			if (acm)
-				qos_data->wmm_acm |= (0x01<<0)|(0x01<<3);
+				qos_data->wmm_acm |= (0x01 << 0) | (0x01 << 3);
 			break;
 		case 2:
 			/* BIT(4) | BIT(5) */
 			if (acm)
-				qos_data->wmm_acm |= (0x01<<4)|(0x01<<5);
+				qos_data->wmm_acm |= (0x01 << 4) | (0x01 << 5);
 			break;
 		case 3:
 			/* BIT(6) | BIT(7) */
 			if (acm)
-				qos_data->wmm_acm |= (0x01<<6)|(0x01<<7);
+				qos_data->wmm_acm |= (0x01 << 6) | (0x01 << 7);
 			break;
 		case 0:
 		default:
 			/* BIT(1) | BIT(2) */
 			if (acm)
-				qos_data->wmm_acm |= (0x01<<1)|(0x01<<2);
+				qos_data->wmm_acm |= (0x01 << 1) | (0x01 << 2);
 			break;
 		}
 
@@ -1979,7 +1979,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
 	    info_element->data[3] == 0x04) {
 		netdev_dbg(ieee->dev, "MFIE_TYPE_WZC: %d bytes\n",
 			   info_element->len);
-		network->wzc_ie_len = min(info_element->len+2, MAX_WZC_IE_LEN);
+		network->wzc_ie_len = min(info_element->len + 2, MAX_WZC_IE_LEN);
 		memcpy(network->wzc_ie, info_element, network->wzc_ie_len);
 	}
 }
@@ -2139,10 +2139,10 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 			if (info_element->data[2] & 1)
 				network->dtim_data |= RTLLIB_DTIM_MBCAST;
 
-			offset = (info_element->data[2] >> 1)*2;
+			offset = (info_element->data[2] >> 1) * 2;
 
-			if (ieee->assoc_id < 8*offset ||
-			    ieee->assoc_id > 8*(offset + info_element->len - 3))
+			if (ieee->assoc_id < 8 * offset ||
+			    ieee->assoc_id > 8 * (offset + info_element->len - 3))
 				break;
 
 			offset = (ieee->assoc_id / 8) - offset;
@@ -2357,7 +2357,7 @@ static inline int rtllib_network_init(
 	if (rtllib_is_empty_essid(network->ssid, network->ssid_len))
 		network->flags |= NETWORK_EMPTY_ESSID;
 	stats->signal = 30 + (stats->SignalStrength * 70) / 100;
-	stats->noise = rtllib_translate_todbm((u8)(100-stats->signal)) - 25;
+	stats->noise = rtllib_translate_todbm((u8)(100 - stats->signal)) - 25;
 
 	memcpy(&network->stats, stats, sizeof(network->stats));
 
@@ -2545,22 +2545,22 @@ static inline void rtllib_process_probe_response(
 		   "'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
 		   escape_essid(info_element->data, info_element->len),
 		   beacon->header.addr3,
-		   (le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x9)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x8)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x7)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x6)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x5)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x4)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x3)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x2)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x1)) ? '1' : '0',
-		   (le16_to_cpu(beacon->capability) & (1<<0x0)) ? '1' : '0');
+		   (le16_to_cpu(beacon->capability) & (1 << 0xf)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0xe)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0xd)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0xc)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0xb)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0xa)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x9)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x8)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x7)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x6)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x5)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x4)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x3)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x2)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x1)) ? '1' : '0',
+		   (le16_to_cpu(beacon->capability) & (1 << 0x0)) ? '1' : '0');
 
 	if (rtllib_network_init(ieee, beacon, network, stats)) {
 		netdev_dbg(ieee->dev, "Dropped '%s' ( %pM) via %s.\n",

--
2.34.1

#4 lore raw

PATCH RESEND 4/4 staging: rtl8192e: remove blank lines after '{'

In reply to Khadija Kamran

Remove unnecessary blank lines after an open brace as reported by checkpatch.pl

"CHECK: Blank lines aren't necessary after an open brace '{'"

---
 drivers/staging/rtl8192e/rtllib_rx.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +0 -4
index f627dfe66d90..b649d02dc5c8 100644
@@ -1167,7 +1167,6 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
 	if (crypt && !(fc & RTLLIB_FCTL_WEP) && !ieee->open_wep) {
 		if (/*ieee->ieee802_1x &&*/
 		    rtllib_is_eapol_frame(ieee, skb, hdrlen)) {
-
 			/* pass unencrypted EAPOL frames even if encryption is
 			 * configured
 			 */
@@ -1207,7 +1206,6 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
 				      u8 nr_subframes)
 {
 	if (unicast) {
-
 		if (ieee->state == RTLLIB_LINKED) {
 			if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
 			    ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
@@ -1552,7 +1550,6 @@ static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
 static int rtllib_verify_qos_info(struct rtllib_qos_information_element
 				     *info_element, int sub_type)
 {
-
 	if (info_element->elementID != QOS_ELEMENT_ID)
 		return -1;
 	if (info_element->qui_subtype != sub_type)
@@ -2696,7 +2693,6 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
 		ieee->last_rx_ps_time = jiffies;
 
 	switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
-
 	case RTLLIB_STYPE_BEACON:
 		netdev_dbg(ieee->dev, "received BEACON (%d)\n",
 			   WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));

--
2.34.1

#5 lore raw
In reply to Khadija Kamran
Quoted 2 lines · Khadija Kamran

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

julia

Quoted 15 lines

Khadija Kamran (4):
staging: rtl8192e: remove extra blank lines
staging: rtl8192e: add blank lines after declarations
staging: rtl8192e: add spaces around binary operators
staging: rtl8192e: remove blank lines after '{'

 drivers/staging/rtl8192e/rtllib_rx.c | 73 +++++++++++-----------------
 1 file changed, 29 insertions(+), 44 deletions(-)

--
2.34.1

#6 lore raw
Quoted 8 lines · Julia Lawall
Quoted 2 lines · Khadija Kamran

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

julia

Quoted 19 lines

julia

Quoted 15 lines

Khadija Kamran (4):
staging: rtl8192e: remove extra blank lines
staging: rtl8192e: add blank lines after declarations
staging: rtl8192e: add spaces around binary operators
staging: rtl8192e: remove blank lines after '{'

 drivers/staging/rtl8192e/rtllib_rx.c | 73 +++++++++++-----------------
 1 file changed, 29 insertions(+), 44 deletions(-)

--
2.34.1

#7 lore raw
Quoted 6 lines · Julia Lawall
Quoted 2 lines · Julia Lawall
Quoted 8 lines
Quoted 6 lines · Khadija Kamran
Quoted 3 lines

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

I'm still confused... :P

regards,
dan carpenter

#8 lore raw
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Julia Lawall
Quoted 4 lines · Julia Lawall

On Thu, 23 Mar 2023, Khadija Kamran wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

I'm still confused... :P

Hey Dan!

Sorry about the confusion. I sent the last patch with the wrong email mistakenly. It was causing following warning as reported by Philipp, Checkpatch:

WARNING: From:/Signed-off-by: email address mismatch: 'From: Khadija Kamran <[email protected]>' != 'Signed-off-by: Khadija Kamran <[email protected]>

I resent this patch with the correct email address. I hope I did not do this wrong.

Regards,
Khadija

Quoted 3 lines

regards,
dan carpenter

maintainer
#9 lore raw
Quoted 26 lines · Khadija Kamran
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Julia Lawall
Quoted 4 lines · Julia Lawall

On Thu, 23 Mar 2023, Khadija Kamran wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

I'm still confused... :P

Hey Dan!

Sorry about the confusion. I sent the last patch with the wrong email mistakenly. It was causing following warning as reported by Philipp, Checkpatch:

Quoted 6 lines

WARNING: From:/Signed-off-by: email address mismatch: 'From: Khadija Kamran <[email protected]>' != 'Signed-off-by: Khadija Kamran <[email protected]>

I resent this patch with the correct email address. I hope I did not do this wrong.

That would be a totally new version, as something changed, so document it, otherwise we are confused.

thanks,

greg k-h

#10 lore raw
In reply to Khadija Kamran
Quoted 26 lines · Khadija Kamran
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Julia Lawall
Quoted 4 lines · Julia Lawall

On Thu, 23 Mar 2023, Khadija Kamran wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

I'm still confused... :P

Hey Dan!

Sorry about the confusion. I sent the last patch with the wrong email mistakenly. It was causing following warning as reported by Philipp, Checkpatch:

Quoted 6 lines

WARNING: From:/Signed-off-by: email address mismatch: 'From: Khadija Kamran <[email protected]>' != 'Signed-off-by: Khadija Kamran <[email protected]>

I resent this patch with the correct email address. I hope I did not do this wrong.

It needs to be v2: resend from the correct email address.

When you send a patch a second time that always needs to be explained because we don't remember all the email we get. The v2 information is really interesting as a reviewer. Maybe I am wondering, "Did I respond to the original email and is my complaint fixed?"

For RESEND patches it means that the first patch was perfect but something broke down in the process. Maybe a maintainer was on vacation and accidentally ignored the patch. If Greg asks you to resend everything that's a kind of breakdown in the process as well, but just add that information in the patch "Resending all the most/ patches because it was confusing which one were supposed to be applied".

That information is super interesting because it shows we are all on the same page about how to go forward.

regards,
dan carpenter

#11 lore raw
Quoted 48 lines · Dan Carpenter
Quoted 26 lines · Khadija Kamran
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Julia Lawall
Quoted 4 lines · Julia Lawall

On Thu, 23 Mar 2023, Khadija Kamran wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Fix several cleanup issues reported by checkpatch.pl in module staging/rtl8192e in file rtllib_rx.c

Why is it resent?

OK, I see, sorry for the noise.

I'm still confused... :P

Hey Dan!

Sorry about the confusion. I sent the last patch with the wrong email mistakenly. It was causing following warning as reported by Philipp, Checkpatch:

Quoted 6 lines

WARNING: From:/Signed-off-by: email address mismatch: 'From: Khadija Kamran <[email protected]>' != 'Signed-off-by: Khadija Kamran <[email protected]>

I resent this patch with the correct email address. I hope I did not do this wrong.

It needs to be v2: resend from the correct email address.

When you send a patch a second time that always needs to be explained because we don't remember all the email we get. The v2 information is really interesting as a reviewer. Maybe I am wondering, "Did I respond to the original email and is my complaint fixed?"

For RESEND patches it means that the first patch was perfect but something broke down in the process. Maybe a maintainer was on vacation and accidentally ignored the patch. If Greg asks you to resend everything that's a kind of breakdown in the process as well, but just add that information in the patch "Resending all the most/ patches because it was confusing which one were supposed to be applied".

Quoted 3 lines

That information is super interesting because it shows we are all on the same page about how to go forward.

Hey Dan,

Thank you for the explanation. I understand and I will make sure to always add some information regarding the patch if resent.

Regards,
Khadija

Quoted 2 lines

regards,
dan carpenter