From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: Mamta Shukla <mamtashukla555@gmail.com>,
Nishka Dasgupta <nishka.dasgupta@yahoo.com>,
Hardik Singh Rathore <hardiksingh.k@gmail.com>,
Anirudh Rayabharam <anirudh.rayabharam@gmail.com>,
Murray McAllister <murray.mcallister@insomniasec.com>,
Kimberly Brown <kimbrownkd@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: core: rtw_ap: fix Unneeded variable: "ret". Return "0"
Date: Mon, 20 May 2019 10:53:17 +0200 [thread overview]
Message-ID: <20190520085317.GB19183@kroah.com> (raw)
In-Reply-To: <20190519164445.GA5268@hari-Inspiron-1545>
On Sun, May 19, 2019 at 10:14:45PM +0530, Hariprasad Kelam wrote:
> This patch fixes below warnings reported by coccicheck
>
> drivers/staging/rtl8723bs/core/rtw_ap.c:1400:5-8: Unneeded variable:
> "ret". Return "0" on line 1441
> drivers/staging/rtl8723bs/core/rtw_ap.c:2195:5-8: Unneeded variable:
> "ret". Return "0" on line 2205
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_ap.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index bc02306..a1b5ba4 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -1397,7 +1397,6 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
> int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
> {
> struct list_head *plist, *phead;
> - int ret = 0;
> struct rtw_wlan_acl_node *paclnode;
> struct sta_priv *pstapriv = &padapter->stapriv;
> struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
> @@ -1438,7 +1437,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
>
> DBG_871X("%s, acl_num =%d\n", __func__, pacl_list->num);
>
> - return ret;
> + return 0;
> }
If this function can never fail, why does it have a return value at all?
Please fix that up instead.
>
> u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
> @@ -2192,7 +2191,6 @@ u8 ap_free_sta(
> 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;
> @@ -2202,7 +2200,7 @@ int rtw_sta_flush(struct adapter *padapter)
> DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
>
> if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
> - return ret;
> + return 0;
>
> spin_lock_bh(&pstapriv->asoc_list_lock);
> phead = &pstapriv->asoc_list;
> @@ -2227,7 +2225,7 @@ int rtw_sta_flush(struct adapter *padapter)
>
> associated_clients_update(padapter, true);
>
> - return ret;
> + return 0;
> }
Same here.
thanks,
greg k-h
prev parent reply other threads:[~2019-05-20 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-19 16:44 Hariprasad Kelam
2019-05-20 8:53 ` Greg Kroah-Hartman [this message]
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=20190520085317.GB19183@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=anirudh.rayabharam@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=hardiksingh.k@gmail.com \
--cc=hariprasad.kelam@gmail.com \
--cc=kimbrownkd@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mamtashukla555@gmail.com \
--cc=murray.mcallister@insomniasec.com \
--cc=nishka.dasgupta@yahoo.com \
/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®