Skip to contentSkip to conversation

Staging: rtl8712: Removed unnecessary parentheses

PATCH In review Brandon Crain 3 participants 3 messages Mar 22, 2024 – Mar 25, 2024 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8712: Removed unnecessary parentheses

Removed uneccessary parentheses from source file

---
 drivers/staging/rtl8712/recv_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/recv_linux.c +1 -1
index 215fca4abb3a..2bf4661432a9 100644
@@ -105,7 +105,7 @@ void r8712_recv_indicatepkt(struct _adapter *adapter,
 	skb->data = recvframe->u.hdr.rx_data;
 	skb->len = recvframe->u.hdr.len;
 	skb_set_tail_pointer(skb, skb->len);
-	if ((attrib->tcpchk_valid == 1) && (attrib->tcp_chkrpt == 1))
+	if (attrib->tcpchk_valid == 1 && attrib->tcp_chkrpt == 1)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 	else
 		skb->ip_summed = CHECKSUM_NONE;
Signature · 1 line
2.34.1
#1 lore raw

On 3/22/24 16:11, Brandon Crain wrote:
Please make your "Subject" line more unique. Consider that we may end up
with having dozen of commits like yours, all of them referring to
different removals and all without the necessary information to tell what they differ in (except the driver/subsystem). So it would help if you add the changed file or function to make it more unique.

Quoted 1 line

Removed uneccessary parentheses from source file

Please use a full sentences with final dot. Always consider that the why is most important to answer. In your case the answer would be "because it is unnecessary" My preferred proposal would be:

Remove unnecessary parentheses to increase readability.

Quoted 11 lines
---
  drivers/staging/rtl8712/recv_linux.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/recv_linux.c +0 -0
index 215fca4abb3a..2bf4661432a9 100644

drivers/staging/rtl8712/recv_linux.c void r8712_recv_indicatepkt(struct _adapter *adapter, · line 108

Quoted 5 lines
drivers/staging/rtl8712/recv_linux.c +1 -1
@@ -105,7 +105,7 @@ void r8712_recv_indicatepkt(struct _adapter *adapter,
  	skb->data = recvframe->u.hdr.rx_data;
  	skb->len = recvframe->u.hdr.len;
  	skb_set_tail_pointer(skb, skb->len);
-	if ((attrib->tcpchk_valid == 1) && (attrib->tcp_chkrpt == 1))
+	if (attrib->tcpchk_valid == 1 && attrib->tcp_chkrpt == 1)

I am not so happy with this proposal I need to know the exact rules that the == has priority over &&. So I like to read it with brackets.

drivers/staging/rtl8712/recv_linux.c void r8712_recv_indicatepkt(struct _adapter *adapter, · line 111

Quoted 3 lines
drivers/staging/rtl8712/recv_linux.c +0 -0
  		skb->ip_summed = CHECKSUM_UNNECESSARY;
  	else
  		skb->ip_summed = CHECKSUM_NONE;

If you send in a second version of this patch please use a change history. Description from Dan under:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Thanks for your support.

Bye Philipp

maintainer
#2 lore raw
In reply to Brandon Crain
Quoted 24 lines · Brandon Crain

Removed uneccessary parentheses from source file

---
 drivers/staging/rtl8712/recv_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/recv_linux.c +1 -1
index 215fca4abb3a..2bf4661432a9 100644
@@ -105,7 +105,7 @@ void r8712_recv_indicatepkt(struct _adapter *adapter,
 	skb->data = recvframe->u.hdr.rx_data;
 	skb->len = recvframe->u.hdr.len;
 	skb_set_tail_pointer(skb, skb->len);
-	if ((attrib->tcpchk_valid == 1) && (attrib->tcp_chkrpt == 1))
+	if (attrib->tcpchk_valid == 1 && attrib->tcp_chkrpt == 1)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 	else
 		skb->ip_summed = CHECKSUM_NONE;
Signature · 1 line
2.34.1

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- You sent a patch that has been sent multiple times in the past and is identical to ones that has been recently rejected. Please always look at the mailing list traffic to determine if you are duplicating other people's work.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot