From: Kang Minchul <tegongkang@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Pavel Skripkin <paskripkin@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Kang Minchul <tegongkang@gmail.com>
Subject: [PATCH v2 4/4] staging: r8188eu: remove unnecessary variable in rtw_ap
Date: Mon, 24 Oct 2022 17:49:25 +0900 [thread overview]
Message-ID: <20221024084925.262289-5-tegongkang@gmail.com> (raw)
In-Reply-To: <20221024084925.262289-1-tegongkang@gmail.com>
Return 0 directly instead of storing it in a variable.
This can prevent cocci warning as follows:
Unneeded variable: "ret". Return "0" on line 1031
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
---
drivers/staging/r8188eu/core/rtw_ap.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_ap.c b/drivers/staging/r8188eu/core/rtw_ap.c
index 24eb8dce9bfe..9eaf345e6a00 100644
--- a/drivers/staging/r8188eu/core/rtw_ap.c
+++ b/drivers/staging/r8188eu/core/rtw_ap.c
@@ -1020,7 +1020,6 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
int rtw_sta_flush(struct adapter *padapter)
{
struct list_head *phead, *plist;
- int ret = 0;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -1028,7 +1027,7 @@ int rtw_sta_flush(struct adapter *padapter)
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
- return ret;
+ return 0;
spin_lock_bh(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list;
@@ -1051,7 +1050,7 @@ int rtw_sta_flush(struct adapter *padapter)
associated_clients_update(padapter, true);
- return ret;
+ return 0;
}
/* called > TSR LEVEL for USB or SDIO Interface*/
--
2.34.1
next prev parent reply other threads:[~2022-10-24 8:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 8:49 [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables Kang Minchul
2022-10-24 8:49 ` [PATCH v2 1/4] staging: r8188eu: remove unnecessary variable in ioctl_linux Kang Minchul
2022-10-24 8:49 ` [PATCH v2 2/4] staging: r8188eu: make amsdu_to_msdu void function Kang Minchul
2022-10-24 12:49 ` kernel test robot
2022-10-24 8:49 ` [PATCH v2 3/4] staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit Kang Minchul
2022-10-24 8:49 ` Kang Minchul [this message]
2022-10-24 11:23 ` [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables Kang Minchul
2022-10-25 17:22 ` Greg Kroah-Hartman
2022-10-25 17:33 ` Kang Minchul
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=20221024084925.262289-5-tegongkang@gmail.com \
--to=tegongkang@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.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