mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
To: Martyn Welch <martyn@welchs.me.uk>,
	Manohar Vanga <manohar.vanga@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Cc: abhirupdeb@linux.vnet.ibm.com
Subject: [PATCH 3/5] staging: r8188eu: remove redundant else after return
Date: Wed, 29 Mar 2023 22:31:37 +0530	[thread overview]
Message-ID: <52c5f24785b8a243e96904e3f26d0bbd63d34e6f.1679988016.git.abhirupdeb@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1679988016.git.abhirupdeb@linux.vnet.ibm.com>

remove 'else'-clause that is not required after a
'return' statement.

checkpatch warning produced:

WARNING: else is not generally useful after a break or return

Signed-off-by: Abhirup Deb <abhirupdeb@linux.vnet.ibm.com>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c | 61 ++++++++++-----------
 drivers/staging/r8188eu/hal/usb_halinit.c   |  7 ++-
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 1b9cf7596a76..6302901a3be1 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -7721,49 +7721,48 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
 	if (send_beacon(padapter) == _FAIL) {
 		return H2C_PARAMETERS_ERROR;
-	} else {
-		/* tx bc/mc frames after update TIM */
-		struct sta_info *psta_bmc;
-		struct list_head *xmitframe_plist, *xmitframe_phead;
-		struct xmit_frame *pxmitframe = NULL;
-		struct sta_priv  *pstapriv = &padapter->stapriv;
+	}
+	/* tx bc/mc frames after update TIM */
+	struct sta_info *psta_bmc;
+	struct list_head *xmitframe_plist, *xmitframe_phead;
+	struct xmit_frame *pxmitframe = NULL;
+	struct sta_priv  *pstapriv = &padapter->stapriv;
 
-		/* for BC/MC Frames */
-		psta_bmc = rtw_get_bcmc_stainfo(padapter);
-		if (!psta_bmc)
-			return H2C_SUCCESS;
+	/* for BC/MC Frames */
+	psta_bmc = rtw_get_bcmc_stainfo(padapter);
+	if (!psta_bmc)
+		return H2C_SUCCESS;
 
-		if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
-			msleep(10);/*  10ms, ATIM(HIQ) Windows */
-			spin_lock_bh(&psta_bmc->sleep_q.lock);
+	if ((pstapriv->tim_bitmap & BIT(0)) && (psta_bmc->sleepq_len > 0)) {
+		msleep(10);/*  10ms, ATIM(HIQ) Windows */
+		spin_lock_bh(&psta_bmc->sleep_q.lock);
 
-			xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
-			xmitframe_plist = xmitframe_phead->next;
+		xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
+		xmitframe_plist = xmitframe_phead->next;
 
-			while (xmitframe_phead != xmitframe_plist) {
-				pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
+		while (xmitframe_phead != xmitframe_plist) {
+			pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
-				xmitframe_plist = xmitframe_plist->next;
+			xmitframe_plist = xmitframe_plist->next;
 
-				list_del_init(&pxmitframe->list);
+			list_del_init(&pxmitframe->list);
 
-				psta_bmc->sleepq_len--;
-				if (psta_bmc->sleepq_len > 0)
-					pxmitframe->attrib.mdata = 1;
-				else
-					pxmitframe->attrib.mdata = 0;
+			psta_bmc->sleepq_len--;
+			if (psta_bmc->sleepq_len > 0)
+				pxmitframe->attrib.mdata = 1;
+			else
+				pxmitframe->attrib.mdata = 0;
 
-				pxmitframe->attrib.triggered = 1;
+			pxmitframe->attrib.triggered = 1;
 
-				pxmitframe->attrib.qsel = 0x11;/* HIQ */
+			pxmitframe->attrib.qsel = 0x11;/* HIQ */
 
-				spin_unlock_bh(&psta_bmc->sleep_q.lock);
-				if (rtl8188eu_hal_xmit(padapter, pxmitframe))
-					rtw_xmit_complete(padapter, pxmitframe);
-				spin_lock_bh(&psta_bmc->sleep_q.lock);
-			}
 			spin_unlock_bh(&psta_bmc->sleep_q.lock);
+			if (rtl8188eu_hal_xmit(padapter, pxmitframe))
+				rtw_xmit_complete(padapter, pxmitframe);
+			spin_lock_bh(&psta_bmc->sleep_q.lock);
 		}
+		spin_unlock_bh(&psta_bmc->sleep_q.lock);
 	}
 	return H2C_SUCCESS;
 }
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 9c2774eb5f78..8a8d74f0f2a6 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -596,10 +596,11 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
 		Adapter->bFWReady = false;
 		haldata->fw_ractrl = false;
 		return status;
-	} else {
-		Adapter->bFWReady = true;
-		haldata->fw_ractrl = false;
 	}
+
+	Adapter->bFWReady = true;
+	haldata->fw_ractrl = false;
+
 	/* Initialize firmware vars */
 	Adapter->pwrctrlpriv.bFwCurrentInPSMode = false;
 	haldata->LastHMEBoxNum = 0;
-- 
2.31.1


  parent reply	other threads:[~2023-03-29 17:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 17:01 [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Abhirup Deb
2023-03-29 17:01 ` [PATCH 1/5] staging: r8188eu: add blank line after declaration Abhirup Deb
2023-03-29 17:01 ` [PATCH 2/5] staging: r8188eu: refactor block-comments Abhirup Deb
2023-03-29 17:01 ` Abhirup Deb [this message]
2023-03-29 17:01 ` [PATCH 4/5] staging: r8188eu: Replace "<<" with BIT macro Abhirup Deb
2023-03-29 17:01 ` [PATCH 5/5] staging: r8188eu: place constants on right side of comparison Abhirup Deb
2023-03-29 18:48 ` [PATCH 0/5] staging: r8188eu: code cleanup and coding-style fix patches Philipp Hortmann

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=52c5f24785b8a243e96904e3f26d0bbd63d34e6f.1679988016.git.abhirupdeb@linux.vnet.ibm.com \
    --to=abhirupdeb@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn@welchs.me.uk \
    /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®