Skip to contentSkip to conversation

staging: wilc1000: Remove an unnecessary else after break

PATCH In review Anchal Jain 2 participants 2 messages Feb 18, 2016 – Feb 20, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Remove an unnecessary else after break

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

---
 drivers/staging/wilc1000/wilc_wlan.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +12 -15
index 4f8474f..31dc138 100644
@@ -658,8 +658,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 		if (i == 0)
 			break;
-		else
-			vmm_table[i] = 0x0;
+		vmm_table[i] = 0x0;
 
 		acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
 		counter = 0;
@@ -670,16 +669,14 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 			if (!ret)
 				break;
 
-			if ((reg & 0x1) == 0) {
+			if ((reg & 0x1) == 0)
+				break;
+			counter++;
+			if (counter > 200) {
+				counter = 0;
+				ret = wilc->hif_func->hif_write_reg(
+					wilc, WILC_HOST_TX_CTRL, 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);
 
@@ -708,9 +705,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if ((reg >> 2) & 0x1) {
 					entries = ((reg >> 3) & 0x3f);
 					break;
-				} else {
-					release_bus(wilc, RELEASE_ALLOW_SLEEP);
 				}
+				release_bus(wilc, RELEASE_ALLOW_SLEEP);
+
 			} while (--timeout);
 			if (timeout <= 0) {
 				ret = wilc->hif_func->hif_write_reg(wilc,
@@ -732,9 +729,9 @@ 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
maintainer
#1 lore raw
Quoted 6 lines · Anchal Jain

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

---
 drivers/staging/wilc1000/wilc_wlan.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

This patch doesn't apply against my staging-testing branch of the staging.git tree. Please rebase it and resend.

thanks,

greg k-h