mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthias Beyer <mail@beyermatthias.de>
To: gregkh@linuxfoundation.org
Cc: Matthias Beyer <mail@beyermatthias.de>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Jes Sorensen <Jes.Sorensen@redhat.com>,
	Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>,
	Geliang Tang <geliangtang@163.com>,
	Cihangir Akturk <cakturk@gmail.com>,
	linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] drivers: staging: rtl8723au: core: simplify if-break-else
Date: Sun,  4 Sep 2016 21:26:23 +0200	[thread overview]
Message-ID: <20160904192626.17197-3-mail@beyermatthias.de> (raw)
In-Reply-To: <20160904192626.17197-1-mail@beyermatthias.de>

As the if statement breaks/continues the loop, the else block is not
useful and can be omitted.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 8b8b6a9..da9f298 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -244,21 +244,18 @@ static void _rtw_roaming(struct rtw_adapter *padapter,
 			do_join_r = rtw_do_join(padapter);
 			if (do_join_r == _SUCCESS)
 				break;
-			else {
-				DBG_8723A("roaming do_join return %d\n",
-					  do_join_r);
-				pmlmepriv->to_roaming--;
 
-				if (padapter->mlmepriv.to_roaming > 0)
-					continue;
-				else {
-					DBG_8723A("%s(%d) -to roaming fail, "
-						  "indicate_disconnect\n",
-						  __func__, __LINE__);
-					rtw_indicate_disconnect23a(padapter);
-					break;
-				}
-			}
+			DBG_8723A("roaming do_join return %d\n", do_join_r);
+			pmlmepriv->to_roaming--;
+
+			if (padapter->mlmepriv.to_roaming > 0)
+				continue;
+
+			DBG_8723A("%s(%d) -to roaming fail, "
+				  "indicate_disconnect\n",
+				  __func__, __LINE__);
+			rtw_indicate_disconnect23a(padapter);
+			break;
 		}
 	}
 }
-- 
2.9.3

  parent reply	other threads:[~2016-09-04 19:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
2016-09-04 19:26 ` [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors Matthias Beyer
2016-09-04 19:26 ` Matthias Beyer [this message]
2016-09-04 19:26 ` [PATCH 3/5] drivers: staging: rtl8723au: core: Refactor pointless branching Matthias Beyer
2016-09-04 19:26 ` [PATCH 4/5] drivers: staging: rtl8723au: core: Fix "space prohibited" warning Matthias Beyer
2016-09-04 19:26 ` [PATCH 5/5] drivers: staging: rtl8723au: core: Fix indentation Matthias Beyer
2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
2016-09-06 16:08   ` Joe Perches
2016-09-06 16:11     ` Jes Sorensen
2016-09-07  7:43   ` Matthias Beyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160904192626.17197-3-mail@beyermatthias.de \
    --to=mail@beyermatthias.de \
    --cc=Jes.Sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=cakturk@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=geliangtang@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=manuel.johannes.messner@hs-furtwangen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®