Skip to contentSkip to conversation

staging: wilc1000: Avoid excessive indentation

PATCH Superseded Tamara Diaconita 2 participants 2 messages Mar 11, 2017 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Avoid excessive indentation

Modified if/else segment to avoid excessive indentation. Fix the checkpatch.pl warning:
WARNING: line over 80 characters.

---
 drivers/staging/wilc1000/linux_wlan.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +5 -6
index 2eebc62..0292aab 100644
@@ -866,14 +866,13 @@ static int wilc_mac_open(struct net_device *ndev)
 				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 wl->open_ifcs);
-			} else {
-				if (memcmp(wl->vif[i ^ 1]->bssid,
-					   wl->vif[i ^ 1]->src_addr, 6))
-					wilc_set_wfi_drv_handler(vif,
+			} else if (memcmp(wl->vif[i ^ 1]->bssid,
+					   wl->vif[i ^ 1]->src_addr, 6)){
+				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 0);
-				else
-					wilc_set_wfi_drv_handler(vif,
+			else
+				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 1);
 			}
Signature · 1 line
2.9.3
#1 lore raw
Quoted 14 lines · Tamara Diaconita

Modified if/else segment to avoid excessive indentation. Fix the checkpatch.pl warning:
WARNING: line over 80 characters.

---
 drivers/staging/wilc1000/linux_wlan.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +0 -0
index 2eebc62..0292aab 100644

drivers/staging/wilc1000/linux_wlan.c static int wilc_mac_open(struct net_device *ndev) · line 870

Quoted 9 lines
drivers/staging/wilc1000/linux_wlan.c +2 -4
@@ -866,14 +866,13 @@ static int wilc_mac_open(struct net_device *ndev)
 				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 wl->open_ifcs);
-			} else {
-				if (memcmp(wl->vif[i ^ 1]->bssid,
-					   wl->vif[i ^ 1]->src_addr, 6))
-					wilc_set_wfi_drv_handler(vif,
+			} else if (memcmp(wl->vif[i ^ 1]->bssid,
+					   wl->vif[i ^ 1]->src_addr, 6)){

This line is not properly aligned with the line above. And the { needs a space in front of it.

Also, more braces are needed overall, to follow the principle that if one branch has braces then they all should have them.

julia

Quoted 20 lines
drivers/staging/wilc1000/linux_wlan.c +3 -3
+				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 0);
-				else
-					wilc_set_wfi_drv_handler(vif,
+			else
+				wilc_set_wfi_drv_handler(vif,
 							 wilc_get_vif_idx(vif),
 							 1);
 			}
--

2.9.3

--
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 post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170311102419.7302-1-diaconita.tamara%40gmail.com.
For more options, visit https://groups.google.com/d/optout.