2023-03-23 12:53:24

by Khadija Kamran

[permalink] [raw]
Subject: [RESEND PATCH 0/4] 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


2023-03-23 13:02:37

by Khadija Kamran

[permalink] [raw]
Subject: [RESEND PATCH 3/4] staging: rtl8192e: add spaces around binary operators

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

Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_rx.c | 54 ++++++++++++++--------------
1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 7144a0630ea6..f627dfe66d90 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -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

2023-03-23 13:21:00

by Khadija Kamran

[permalink] [raw]
Subject: [RESEND PATCH 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"

Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_rx.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index c394c21beefb..c6114d99829b 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -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

2023-03-23 13:34:05

by Julia Lawall

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches



On Thu, 23 Mar 2023, Khadija Kamran wrote:

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

Why is it resent?

julia

>
> 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
>
>
>

2023-03-23 13:41:42

by Julia Lawall

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches



On Thu, 23 Mar 2023, Julia Lawall wrote:

>
>
> On Thu, 23 Mar 2023, Khadija Kamran wrote:
>
> > 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

>
> julia
>
> >
> > 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
> >
> >
> >
>

2023-03-23 13:44:02

by Dan Carpenter

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches

On Thu, Mar 23, 2023 at 02:08:58PM +0100, Julia Lawall wrote:
>
>
> On Thu, 23 Mar 2023, Julia Lawall wrote:
>
> >
> >
> > On Thu, 23 Mar 2023, Khadija Kamran wrote:
> >
> > > 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

2023-03-23 15:25:11

by Khadija Kamran

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches

On Thu, Mar 23, 2023 at 04:34:43PM +0300, Dan Carpenter wrote:
> On Thu, Mar 23, 2023 at 02:08:58PM +0100, Julia Lawall wrote:
> >
> >
> > On Thu, 23 Mar 2023, Julia Lawall wrote:
> >
> > >
> > >
> > > On Thu, 23 Mar 2023, Khadija Kamran wrote:
> > >
> > > > 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

> regards,
> dan carpenter
>

2023-03-23 15:48:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches

On Thu, Mar 23, 2023 at 08:23:17PM +0500, Khadija Kamran wrote:
> On Thu, Mar 23, 2023 at 04:34:43PM +0300, Dan Carpenter wrote:
> > On Thu, Mar 23, 2023 at 02:08:58PM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Thu, 23 Mar 2023, Julia Lawall wrote:
> > >
> > > >
> > > >
> > > > On Thu, 23 Mar 2023, Khadija Kamran wrote:
> > > >
> > > > > 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.

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

thanks,

greg k-h

2023-03-23 15:50:28

by Dan Carpenter

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches

On Thu, Mar 23, 2023 at 08:23:17PM +0500, Khadija Kamran wrote:
> On Thu, Mar 23, 2023 at 04:34:43PM +0300, Dan Carpenter wrote:
> > On Thu, Mar 23, 2023 at 02:08:58PM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Thu, 23 Mar 2023, Julia Lawall wrote:
> > >
> > > >
> > > >
> > > > On Thu, 23 Mar 2023, Khadija Kamran wrote:
> > > >
> > > > > 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.

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

2023-03-23 19:35:23

by Khadija Kamran

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/4] staging: rtl8192e: code cleanup patches

On Thu, Mar 23, 2023 at 06:32:54PM +0300, Dan Carpenter wrote:
> On Thu, Mar 23, 2023 at 08:23:17PM +0500, Khadija Kamran wrote:
> > On Thu, Mar 23, 2023 at 04:34:43PM +0300, Dan Carpenter wrote:
> > > On Thu, Mar 23, 2023 at 02:08:58PM +0100, Julia Lawall wrote:
> > > >
> > > >
> > > > On Thu, 23 Mar 2023, Julia Lawall wrote:
> > > >
> > > > >
> > > > >
> > > > > On Thu, 23 Mar 2023, Khadija Kamran wrote:
> > > > >
> > > > > > 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.
>
> 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.
>

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

> regards,
> dan carpenter