All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: wilc1000: Remove an unnecessary else after break
@ 2016-02-18 16:14 Anchal Jain
  2016-02-20  1:07 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Anchal Jain @ 2016-02-18 16:14 UTC (permalink / raw)
  To: outreachy-kernel

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

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4f8474f..31dc138 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -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)
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: wilc1000: Remove an unnecessary else after break
  2016-02-18 16:14 [PATCH] staging: wilc1000: Remove an unnecessary else after break Anchal Jain
@ 2016-02-20  1:07 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-02-20  1:07 UTC (permalink / raw)
  To: Anchal Jain; +Cc: outreachy-kernel

On Thu, Feb 18, 2016 at 09:44:10PM +0530, Anchal Jain wrote:
> Remove else after a break. Because else is generally not useful after a break or return.
> 
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
>  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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-20  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 16:14 [PATCH] staging: wilc1000: Remove an unnecessary else after break Anchal Jain
2016-02-20  1:07 ` [Outreachy kernel] " Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.