linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: r8188eu: add space around arithmatic sign
@ 2022-04-04 14:39 Alaa Mohamed
  2022-04-04 14:39 ` [PATCH 2/2] staging: r8188eu: Add line after declarations Alaa Mohamed
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alaa Mohamed @ 2022-04-04 14:39 UTC (permalink / raw)
  To: outreachy
  Cc: Larry.Finger, phil, gregkh, linux-staging, linux-kernel,
	eng.alaamohamedsoliman.am

Reported by checkpatch:

CHECK: spaces preferred around that '+' , '-' and '*'

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 58 +++++++++++------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index d68611ef22f8..7c664f80fa99 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -87,19 +87,19 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
 	int tail_len;
 	unsigned long end, tail;
 
-	if ((src+len) > skb_tail_pointer(skb) || skb->len < len)
+	if ((src + len) > skb_tail_pointer(skb) || skb->len < len)
 		return -1;
 
 	tail = (unsigned long)skb_tail_pointer(skb);
-	end = (unsigned long)src+len;
+	end = (unsigned long)src + len;
 	if (tail < end)
 		return -1;
 
-	tail_len = (int)(tail-end);
+	tail_len = (int)(tail - end);
 	if (tail_len > 0)
-		memmove(src, src+len, tail_len);
+		memmove(src, src + len, tail_len);
 
-	skb_trim(skb, skb->len-len);
+	skb_trim(skb, skb->len - len);
 	return 0;
 }
 
@@ -117,7 +117,7 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
 
 	networkAddr[0] = NAT25_IPV4;
-	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
+	memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4);
 }
 
 static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
@@ -126,8 +126,8 @@ static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
 
 	networkAddr[0] = NAT25_PPPOE;
-	memcpy(networkAddr+1, (unsigned char *)sid, 2);
-	memcpy(networkAddr+3, (unsigned char *)ac_mac, 6);
+	memcpy(networkAddr + 1, (unsigned char *)sid, 2);
+	memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6);
 }
 
 static  void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
@@ -136,17 +136,17 @@ static  void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
 
 	networkAddr[0] = NAT25_IPV6;
-	memcpy(networkAddr+1, (unsigned char *)ipAddr, 16);
+	memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16);
 }
 
 static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b)
 {
 	while (len > 0) {
-		if (*data == tag && *(data+1) == len8b && len >= len8b*8)
-			return data+2;
+		if (*data == tag && *(data + 1) == len8b && len >= len8b * 8)
+			return data + 2;
 
-		len -= (*(data+1))*8;
-		data += (*(data+1))*8;
+		len -= (*(data + 1)) * 8;
+		data += (*(data + 1)) * 8;
 	}
 	return NULL;
 }
@@ -158,7 +158,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 
 	if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
 		if (len >= 8) {
-			mac = scan_tlv(&data[8], len-8, 1, 1);
+			mac = scan_tlv(&data[8], len - 8, 1, 1);
 			if (mac) {
 				memcpy(mac, replace_mac, 6);
 				return 1;
@@ -166,7 +166,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 		}
 	} else if (icmphdr->icmp6_type == NDISC_ROUTER_ADVERTISEMENT) {
 		if (len >= 16) {
-			mac = scan_tlv(&data[16], len-16, 1, 1);
+			mac = scan_tlv(&data[16], len - 16, 1, 1);
 			if (mac) {
 				memcpy(mac, replace_mac, 6);
 				return 1;
@@ -174,7 +174,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 		}
 	} else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
 		if (len >= 24) {
-			mac = scan_tlv(&data[24], len-24, 1, 1);
+			mac = scan_tlv(&data[24], len - 24, 1, 1);
 			if (mac) {
 				memcpy(mac, replace_mac, 6);
 				return 1;
@@ -182,7 +182,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 		}
 	} else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) {
 		if (len >= 24) {
-			mac = scan_tlv(&data[24], len-24, 2, 1);
+			mac = scan_tlv(&data[24], len - 24, 2, 1);
 			if (mac) {
 				memcpy(mac, replace_mac, 6);
 				return 1;
@@ -190,7 +190,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 		}
 	} else if (icmphdr->icmp6_type == NDISC_REDIRECT) {
 		if (len >= 40) {
-			mac = scan_tlv(&data[40], len-40, 2, 1);
+			mac = scan_tlv(&data[40], len - 40, 2, 1);
 			if (mac) {
 				memcpy(mac, replace_mac, 6);
 				return 1;
@@ -396,7 +396,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 			tmp = be32_to_cpu(iph->saddr);
 			__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
 			/* record source IP address and , source mac address into db */
-			__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
+			__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 			return 0;
 		default:
 			return -1;
@@ -421,7 +421,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 			arp_ptr += arp->ar_hln;
 			sender = (unsigned int *)arp_ptr;
 			__nat25_generate_ipv4_network_addr(networkAddr, sender);
-			__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
+			__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 			return 0;
 		default:
 			return -1;
@@ -458,22 +458,22 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 							    sizeof(tag_buf))
 								return -1;
 
-							memcpy(tag->tag_data+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN,
+							memcpy(tag->tag_data + MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN,
 								pOldTag->tag_data, old_tag_len);
 
-							if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN+old_tag_len) < 0)
+							if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN + old_tag_len) < 0)
 								return -1;
 
-							ph->length = htons(ntohs(ph->length)-TAG_HDR_LEN-old_tag_len);
+							ph->length = htons(ntohs(ph->length) - TAG_HDR_LEN - old_tag_len);
 						}
 
 						tag->tag_type = PTT_RELAY_SID;
-						tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len);
+						tag->tag_len = htons(MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN + old_tag_len);
 
 						/*  insert the magic_code+client mac in relay tag */
 						pMagic = (unsigned short *)tag->tag_data;
 						*pMagic = htons(MAGIC_CODE);
-						memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
+						memcpy(tag->tag_data + MAGIC_CODE_LEN, skb->data + ETH_ALEN, ETH_ALEN);
 
 						/* Add relay tag */
 						if (__nat25_add_pppoe_tag(skb, tag) < 0)
@@ -486,7 +486,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 							return -2;
 
 						if (priv->pppoe_connection_in_progress == 0)
-							memcpy(priv->pppoe_addr, skb->data+ETH_ALEN, ETH_ALEN);
+							memcpy(priv->pppoe_addr, skb->data + ETH_ALEN, ETH_ALEN);
 
 						priv->pppoe_connection_in_progress = WAIT_TIME_PPPOE;
 					}
@@ -496,11 +496,11 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 			} else {	/*  session phase */
 				__nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid);
 
-				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
+				__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 
 				if (!priv->ethBrExtInfo.addPPPoETag &&
 				    priv->pppoe_connection_in_progress &&
-				    !memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN))
+				    !memcmp(skb->data + ETH_ALEN, priv->pppoe_addr, ETH_ALEN))
 					priv->pppoe_connection_in_progress = 0;
 			}
 			return 0;
@@ -548,7 +548,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 		case NAT25_INSERT:
 			if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) {
 				__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr);
-				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
+				__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 
 				if (iph->nexthdr == IPPROTO_ICMPV6 &&
 						skb->len > (ETH_HLEN +  sizeof(*iph) + 4)) {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] staging: r8188eu: Add line after declarations
  2022-04-04 14:39 [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alaa Mohamed
@ 2022-04-04 14:39 ` Alaa Mohamed
  2022-04-04 18:47   ` Larry Finger
  2022-04-05  0:10 ` [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alison Schofield
  2022-04-05 13:46 ` Greg KH
  2 siblings, 1 reply; 6+ messages in thread
From: Alaa Mohamed @ 2022-04-04 14:39 UTC (permalink / raw)
  To: outreachy
  Cc: Larry.Finger, phil, gregkh, linux-staging, linux-kernel,
	eng.alaamohamedsoliman.am

Reported by checkpatch:

WARNING: Missing a blank line after declarations

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 7c664f80fa99..f7811b46db1c 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -313,6 +313,7 @@ void nat25_db_cleanup(struct adapter *priv)
 
 	for (i = 0; i < NAT25_HASH_SIZE; i++) {
 		struct nat25_network_db_entry *f;
+
 		f = priv->nethash[i];
 		while (f) {
 			struct nat25_network_db_entry *g;
@@ -339,12 +340,12 @@ void nat25_db_expire(struct adapter *priv)
 
 	for (i = 0; i < NAT25_HASH_SIZE; i++) {
 		struct nat25_network_db_entry *f;
-		f = priv->nethash[i];
 
+		f = priv->nethash[i];
 		while (f) {
 			struct nat25_network_db_entry *g;
-			g = f->next_hash;
 
+			g = f->next_hash;
 			if (__nat25_has_expired(f)) {
 				if (atomic_dec_and_test(&f->use_count)) {
 					if (priv->scdb_entry == f) {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] staging: r8188eu: Add line after declarations
  2022-04-04 14:39 ` [PATCH 2/2] staging: r8188eu: Add line after declarations Alaa Mohamed
@ 2022-04-04 18:47   ` Larry Finger
  2022-04-05 13:45     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2022-04-04 18:47 UTC (permalink / raw)
  To: Alaa Mohamed, outreachy; +Cc: phil, gregkh, linux-staging, linux-kernel

On 4/4/22 09:39, Alaa Mohamed wrote:
> Reported by checkpatch:
> 
> WARNING: Missing a blank line after declarations
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
>   drivers/staging/r8188eu/core/rtw_br_ext.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 7c664f80fa99..f7811b46db1c 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -313,6 +313,7 @@ void nat25_db_cleanup(struct adapter *priv)
>   
>   	for (i = 0; i < NAT25_HASH_SIZE; i++) {
>   		struct nat25_network_db_entry *f;
> +
>   		f = priv->nethash[i];
>   		while (f) {
>   			struct nat25_network_db_entry *g;
> @@ -339,12 +340,12 @@ void nat25_db_expire(struct adapter *priv)
>   
>   	for (i = 0; i < NAT25_HASH_SIZE; i++) {
>   		struct nat25_network_db_entry *f;
> -		f = priv->nethash[i];
>   
> +		f = priv->nethash[i];
>   		while (f) {
>   			struct nat25_network_db_entry *g;
> -			g = f->next_hash;
>   
> +			g = f->next_hash;
>   			if (__nat25_has_expired(f)) {
>   				if (atomic_dec_and_test(&f->use_count)) {
>   					if (priv->scdb_entry == f) {

Acked_by: Larry Finger <Larry.Finger@lwfinger.net>

That applies to both patches.

Thanks,

Larry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] staging: r8188eu: add space around arithmatic sign
  2022-04-04 14:39 [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alaa Mohamed
  2022-04-04 14:39 ` [PATCH 2/2] staging: r8188eu: Add line after declarations Alaa Mohamed
@ 2022-04-05  0:10 ` Alison Schofield
  2022-04-05 13:46 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Alison Schofield @ 2022-04-05  0:10 UTC (permalink / raw)
  To: Alaa Mohamed
  Cc: outreachy, Larry.Finger, phil, gregkh, linux-staging, linux-kernel

On Mon, Apr 04, 2022 at 07:39:16AM -0700, Alaa Mohamed wrote:
> Reported by checkpatch:
> 
> CHECK: spaces preferred around that '+' , '-' and '*'
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>

Hi Alaa,

I see you already picked up an ACK on this!

I'm going to comment on the format since I'm aware this is your
first patchset! The grouping is good - 2 cleanups in same file.
Please search in the tutorial for further info on how to present these
as a patchset. You can also peruse the outreachy list for formats of
patchsets as well. I'd expect to see a cover letter.

The other thing I noticed was this: 
>> [PATCH 1/2] staging: r8188eu: add space around arithmatic sign
>> [PATCH 2/2] staging: r8188eu: Add line after declarations
to which I was going to say - 'Well which is the actual preference
for this file or driver: 'add' or 'Add', ie. uppercase or lowercase?  

Looking at the history, it's mixed. So, I guess I'll just suggest
you don't mix it within a patchset.  If a maintainer cares, and try
to set a pattern for the file or driver..

spelling fixup please:
s/arithmatic/arithmetic

and perhpas this would be clearer:
s/sign/operator   (They are arithmetic operators, not signs.)

Alison

> ---
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 58 +++++++++++------------
>  1 file changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index d68611ef22f8..7c664f80fa99 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -87,19 +87,19 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
>  	int tail_len;
>  	unsigned long end, tail;
>  
> -	if ((src+len) > skb_tail_pointer(skb) || skb->len < len)
> +	if ((src + len) > skb_tail_pointer(skb) || skb->len < len)
>  		return -1;
>  
>  	tail = (unsigned long)skb_tail_pointer(skb);
> -	end = (unsigned long)src+len;
> +	end = (unsigned long)src + len;
>  	if (tail < end)
>  		return -1;
>  
> -	tail_len = (int)(tail-end);
> +	tail_len = (int)(tail - end);
>  	if (tail_len > 0)
> -		memmove(src, src+len, tail_len);
> +		memmove(src, src + len, tail_len);
>  
> -	skb_trim(skb, skb->len-len);
> +	skb_trim(skb, skb->len - len);
>  	return 0;
>  }
>  
> @@ -117,7 +117,7 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
>  	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
>  
>  	networkAddr[0] = NAT25_IPV4;
> -	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
> +	memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4);
>  }
>  
>  static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
> @@ -126,8 +126,8 @@ static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
>  	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
>  
>  	networkAddr[0] = NAT25_PPPOE;
> -	memcpy(networkAddr+1, (unsigned char *)sid, 2);
> -	memcpy(networkAddr+3, (unsigned char *)ac_mac, 6);
> +	memcpy(networkAddr + 1, (unsigned char *)sid, 2);
> +	memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6);
>  }
>  
>  static  void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
> @@ -136,17 +136,17 @@ static  void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
>  	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
>  
>  	networkAddr[0] = NAT25_IPV6;
> -	memcpy(networkAddr+1, (unsigned char *)ipAddr, 16);
> +	memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16);
>  }
>  
>  static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b)
>  {
>  	while (len > 0) {
> -		if (*data == tag && *(data+1) == len8b && len >= len8b*8)
> -			return data+2;
> +		if (*data == tag && *(data + 1) == len8b && len >= len8b * 8)
> +			return data + 2;
>  
> -		len -= (*(data+1))*8;
> -		data += (*(data+1))*8;
> +		len -= (*(data + 1)) * 8;
> +		data += (*(data + 1)) * 8;
>  	}
>  	return NULL;
>  }
> @@ -158,7 +158,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>  
>  	if (icmphdr->icmp6_type == NDISC_ROUTER_SOLICITATION) {
>  		if (len >= 8) {
> -			mac = scan_tlv(&data[8], len-8, 1, 1);
> +			mac = scan_tlv(&data[8], len - 8, 1, 1);
>  			if (mac) {
>  				memcpy(mac, replace_mac, 6);
>  				return 1;
> @@ -166,7 +166,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>  		}
>  	} else if (icmphdr->icmp6_type == NDISC_ROUTER_ADVERTISEMENT) {
>  		if (len >= 16) {
> -			mac = scan_tlv(&data[16], len-16, 1, 1);
> +			mac = scan_tlv(&data[16], len - 16, 1, 1);
>  			if (mac) {
>  				memcpy(mac, replace_mac, 6);
>  				return 1;
> @@ -174,7 +174,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>  		}
>  	} else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
>  		if (len >= 24) {
> -			mac = scan_tlv(&data[24], len-24, 1, 1);
> +			mac = scan_tlv(&data[24], len - 24, 1, 1);
>  			if (mac) {
>  				memcpy(mac, replace_mac, 6);
>  				return 1;
> @@ -182,7 +182,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>  		}
>  	} else if (icmphdr->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT) {
>  		if (len >= 24) {
> -			mac = scan_tlv(&data[24], len-24, 2, 1);
> +			mac = scan_tlv(&data[24], len - 24, 2, 1);
>  			if (mac) {
>  				memcpy(mac, replace_mac, 6);
>  				return 1;
> @@ -190,7 +190,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
>  		}
>  	} else if (icmphdr->icmp6_type == NDISC_REDIRECT) {
>  		if (len >= 40) {
> -			mac = scan_tlv(&data[40], len-40, 2, 1);
> +			mac = scan_tlv(&data[40], len - 40, 2, 1);
>  			if (mac) {
>  				memcpy(mac, replace_mac, 6);
>  				return 1;
> @@ -396,7 +396,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  			tmp = be32_to_cpu(iph->saddr);
>  			__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
>  			/* record source IP address and , source mac address into db */
> -			__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
> +			__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
>  			return 0;
>  		default:
>  			return -1;
> @@ -421,7 +421,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  			arp_ptr += arp->ar_hln;
>  			sender = (unsigned int *)arp_ptr;
>  			__nat25_generate_ipv4_network_addr(networkAddr, sender);
> -			__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
> +			__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
>  			return 0;
>  		default:
>  			return -1;
> @@ -458,22 +458,22 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  							    sizeof(tag_buf))
>  								return -1;
>  
> -							memcpy(tag->tag_data+MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN,
> +							memcpy(tag->tag_data + MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN,
>  								pOldTag->tag_data, old_tag_len);
>  
> -							if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN+old_tag_len) < 0)
> +							if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN + old_tag_len) < 0)
>  								return -1;
>  
> -							ph->length = htons(ntohs(ph->length)-TAG_HDR_LEN-old_tag_len);
> +							ph->length = htons(ntohs(ph->length) - TAG_HDR_LEN - old_tag_len);
>  						}
>  
>  						tag->tag_type = PTT_RELAY_SID;
> -						tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len);
> +						tag->tag_len = htons(MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN + old_tag_len);
>  
>  						/*  insert the magic_code+client mac in relay tag */
>  						pMagic = (unsigned short *)tag->tag_data;
>  						*pMagic = htons(MAGIC_CODE);
> -						memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
> +						memcpy(tag->tag_data + MAGIC_CODE_LEN, skb->data + ETH_ALEN, ETH_ALEN);
>  
>  						/* Add relay tag */
>  						if (__nat25_add_pppoe_tag(skb, tag) < 0)
> @@ -486,7 +486,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  							return -2;
>  
>  						if (priv->pppoe_connection_in_progress == 0)
> -							memcpy(priv->pppoe_addr, skb->data+ETH_ALEN, ETH_ALEN);
> +							memcpy(priv->pppoe_addr, skb->data + ETH_ALEN, ETH_ALEN);
>  
>  						priv->pppoe_connection_in_progress = WAIT_TIME_PPPOE;
>  					}
> @@ -496,11 +496,11 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  			} else {	/*  session phase */
>  				__nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid);
>  
> -				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
> +				__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
>  
>  				if (!priv->ethBrExtInfo.addPPPoETag &&
>  				    priv->pppoe_connection_in_progress &&
> -				    !memcmp(skb->data+ETH_ALEN, priv->pppoe_addr, ETH_ALEN))
> +				    !memcmp(skb->data + ETH_ALEN, priv->pppoe_addr, ETH_ALEN))
>  					priv->pppoe_connection_in_progress = 0;
>  			}
>  			return 0;
> @@ -548,7 +548,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>  		case NAT25_INSERT:
>  			if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) {
>  				__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr);
> -				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
> +				__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
>  
>  				if (iph->nexthdr == IPPROTO_ICMPV6 &&
>  						skb->len > (ETH_HLEN +  sizeof(*iph) + 4)) {
> -- 
> 2.35.1
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] staging: r8188eu: Add line after declarations
  2022-04-04 18:47   ` Larry Finger
@ 2022-04-05 13:45     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-04-05 13:45 UTC (permalink / raw)
  To: Larry Finger; +Cc: Alaa Mohamed, outreachy, phil, linux-staging, linux-kernel

On Mon, Apr 04, 2022 at 01:47:33PM -0500, Larry Finger wrote:
> On 4/4/22 09:39, Alaa Mohamed wrote:
> > Reported by checkpatch:
> > 
> > WARNING: Missing a blank line after declarations
> > 
> > Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> > ---
> >   drivers/staging/r8188eu/core/rtw_br_ext.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> > index 7c664f80fa99..f7811b46db1c 100644
> > --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> > +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> > @@ -313,6 +313,7 @@ void nat25_db_cleanup(struct adapter *priv)
> >   	for (i = 0; i < NAT25_HASH_SIZE; i++) {
> >   		struct nat25_network_db_entry *f;
> > +
> >   		f = priv->nethash[i];
> >   		while (f) {
> >   			struct nat25_network_db_entry *g;
> > @@ -339,12 +340,12 @@ void nat25_db_expire(struct adapter *priv)
> >   	for (i = 0; i < NAT25_HASH_SIZE; i++) {
> >   		struct nat25_network_db_entry *f;
> > -		f = priv->nethash[i];
> > +		f = priv->nethash[i];
> >   		while (f) {
> >   			struct nat25_network_db_entry *g;
> > -			g = f->next_hash;
> > +			g = f->next_hash;
> >   			if (__nat25_has_expired(f)) {
> >   				if (atomic_dec_and_test(&f->use_count)) {
> >   					if (priv->scdb_entry == f) {
> 
> Acked_by: Larry Finger <Larry.Finger@lwfinger.net>
> 
> That applies to both patches.

b4 doesn't pick this ack up for both patches, you either need to do it
on the 0/X message, or on each one individually.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] staging: r8188eu: add space around arithmatic sign
  2022-04-04 14:39 [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alaa Mohamed
  2022-04-04 14:39 ` [PATCH 2/2] staging: r8188eu: Add line after declarations Alaa Mohamed
  2022-04-05  0:10 ` [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alison Schofield
@ 2022-04-05 13:46 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-04-05 13:46 UTC (permalink / raw)
  To: Alaa Mohamed; +Cc: outreachy, Larry.Finger, phil, linux-staging, linux-kernel

On Mon, Apr 04, 2022 at 04:39:16PM +0200, Alaa Mohamed wrote:
> Reported by checkpatch:
> 
> CHECK: spaces preferred around that '+' , '-' and '*'
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 58 +++++++++++------------
>  1 file changed, 29 insertions(+), 29 deletions(-)

This patch does not apply to my tree and branch.  Please rebase and
resend it against the staging-next branch of staging.git.

Patch 2/2 did apply.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-05 23:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 14:39 [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alaa Mohamed
2022-04-04 14:39 ` [PATCH 2/2] staging: r8188eu: Add line after declarations Alaa Mohamed
2022-04-04 18:47   ` Larry Finger
2022-04-05 13:45     ` Greg KH
2022-04-05  0:10 ` [PATCH 1/2] staging: r8188eu: add space around arithmatic sign Alison Schofield
2022-04-05 13:46 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).