Skip to contentSkip to conversation

drivers: staging: wilc1000: else is not generally useful after a break or return

PATCH In review Anchal Jain 2 participants 2 messages Mar 12, 2016 – Mar 13, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: staging: wilc1000: else is not generally useful after a break or return

Remove else after a break. Because else is generally not useful after a break or return.

---
 drivers/staging/wilc1000/wilc_wlan.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +3 -5
index fd938fb..704771a 100644
@@ -626,14 +626,13 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 			if ((reg & 0x1) == 0) {
 				break;
-			} else {
+			}
 				counter++;
 				if (counter > 200) {
 					counter = 0;
 					ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
 					break;
-				}
-			}
+					}
 		} while (!wilc->quit);
 
 		if (!ret)
@@ -679,9 +678,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if (!ret)
 					break;
 				break;
-			} else {
-				break;
 			}
+			break;
 		} while (1);
 
 		if (!ret)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Anchal Jain

Remove else after a break. Because else is generally not useful after a break or return.

The lines in the commit log message should be at most 80 characters, ideally a bit less.

Quoted 10 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +0 -0
index fd938fb..704771a 100644

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) · line 630

Quoted 6 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -1
@@ -626,14 +626,13 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 			if ((reg & 0x1) == 0) {
 				break;
-			} else {
+			}
 				counter++;

The above line and the ones following are no longer inside an if, so they should be less indented.

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) · line 635

Quoted 7 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -2
 				if (counter > 200) {
 					counter = 0;
 					ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
 					break;
-				}
-			}
+					}

The above brace does not appear to be in the right place.

julia

Quoted 24 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -2
 		} while (!wilc->quit);
 
 		if (!ret)
@@ -679,9 +678,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if (!ret)
 					break;
 				break;
-			} else {
-				break;
 			}
+			break;
 		} while (1);
 
 		if (!ret)
Signature · 8 lines
1.9.1

-- 
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/20160312161141.GA3241%40life-desktop.
For more options, visit https://groups.google.com/d/optout.