Skip to contentSkip to conversation

wilc1000 : rearrange line exceeding 80 characters

PATCH In review Deepak R Varma 3 participants 4 messages Mar 10, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wilc1000 : rearrange line exceeding 80 characters

A long if condition exceeding 80 characters that makes evaluation appear confusing. Rearranging the condition makes it easier to understand.

---
 drivers/staging/wilc1000/netdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/netdev.c +4 -2
index 045f5cdfdca0..d7a632c92a76 100644
@@ -802,8 +802,10 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
 		u16 type = le16_to_cpup((__le16 *)buff);
 
 		if (vif->priv.p2p_listen_state &&
-		    ((type == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
-		     (type == vif->frame_reg[1].type && vif->frame_reg[1].reg)))
+		    ((type == vif->frame_reg[0].type &&
+			vif->frame_reg[0].reg) ||
+		     (type == vif->frame_reg[1].type &&
+			vif->frame_reg[1].reg)))
 			wilc_wfi_p2p_rx(vif, buff, size);
 
 		if (vif->monitor_flag)
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 7 lines · Deepak R Varma

A long if condition exceeding 80 characters that makes evaluation appear confusing. Rearranging the condition makes it easier to understand.

---
 drivers/staging/wilc1000/netdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

You forgot "staging:" in your subject line.

Quoted 6 lines
drivers/staging/wilc1000/netdev.c +0 -0
index 045f5cdfdca0..d7a632c92a76 100644

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) · line 808

Quoted 9 lines
drivers/staging/wilc1000/netdev.c +4 -2
@@ -802,8 +802,10 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
 		u16 type = le16_to_cpup((__le16 *)buff);
 
 		if (vif->priv.p2p_listen_state &&
-		    ((type == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
-		     (type == vif->frame_reg[1].type && vif->frame_reg[1].reg)))
+		    ((type == vif->frame_reg[0].type &&
+			vif->frame_reg[0].reg) ||
+		     (type == vif->frame_reg[1].type &&
+			vif->frame_reg[1].reg)))

The original code is really easier to follow than your change, so I would just leave it as-is please.

thanks,

greg k-h

#2 lore raw

Thank you Greg. What you commented makes sense.

Deepak.

Quoted 40 lines · gregkh
Quoted 2 lines · Deepak R Varma

A long if condition exceeding 80 characters that makes evaluation appear confusing. Rearranging the condition makes it easier to

understand.

Quoted 5 lines
Signed-off-by Deepak R Varma <[email protected] <javascript:>>

---

 drivers/staging/wilc1000/netdev.c | 6 ++++-- 
 1 file changed, 4 insertions(+), 2 deletions(-) 

You forgot "staging:" in your subject line.

Review

Quoted 2 lines
(quoted diff) +0 -0

b/drivers/staging/wilc1000/netdev.c

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff,

Quoted 4 lines

index 045f5cdfdca0..d7a632c92a76 100644

drivers/staging/wilc1000/netdev.c +0 -0
@@ -802,8 +802,10 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, 

u32 size)

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)

Quoted 4 lines
drivers/staging/wilc1000/netdev.c +0 -1
                 u16 type = le16_to_cpup((__le16 *)buff); 
 
                 if (vif->priv.p2p_listen_state && 
-                    ((type == vif->frame_reg[0].type && 

vif->frame_reg[0].reg) ||

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, · line 806

Quoted 1 line
drivers/staging/wilc1000/netdev.c +0 -1
-                     (type == vif->frame_reg[1].type && 

vif->frame_reg[1].reg)))

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) · line 808

Quoted 4 lines
drivers/staging/wilc1000/netdev.c +4 -0
+                    ((type == vif->frame_reg[0].type && 
+                        vif->frame_reg[0].reg) || 
+                     (type == vif->frame_reg[1].type && 
+                        vif->frame_reg[1].reg))) 

The original code is really easier to follow than your change, so I would just leave it as-is please.

thanks,

greg k-h

#3 lore raw
Quoted 2 lines · Deepak Varma

Thank you Greg. What you commented makes sense.

Hi Deepak,

Please don't top-post. You can read 'Responding to emails' a section in the kernel first patch tutorial to understand the difference between top-posting and responding inline.

Quoted 42 lines

Deepak.

Quoted 31 lines · gregkh
Quoted 7 lines · Deepak R Varma

A long if condition exceeding 80 characters that makes evaluation appear confusing. Rearranging the condition makes it easier to understand.

---
 drivers/staging/wilc1000/netdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

You forgot "staging:" in your subject line.

Quoted 6 lines
drivers/staging/wilc1000/netdev.c +0 -0
index 045f5cdfdca0..d7a632c92a76 100644

drivers/staging/wilc1000/netdev.c void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) · line 808

Quoted 9 lines
drivers/staging/wilc1000/netdev.c +4 -2
@@ -802,8 +802,10 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
                 u16 type = le16_to_cpup((__le16 *)buff);
 
                 if (vif->priv.p2p_listen_state &&
-                    ((type == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
-                     (type == vif->frame_reg[1].type && vif->frame_reg[1].reg)))
+                    ((type == vif->frame_reg[0].type &&
+                        vif->frame_reg[0].reg) ||
+                     (type == vif->frame_reg[1].type &&
+                        vif->frame_reg[1].reg)))

The original code is really easier to follow than your change, so I would just leave it as-is please.

Quoted 3 lines

thanks,

greg k-h

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/02081ae5-284b-401d-85df-dc1e6911e1f1%40googlegroups.com.