From: Pavel Skripkin <paskripkin@gmail.com>
To: cgel.zte@gmail.com, Larry.Finger@lwfinger.net
Cc: phil@philpotter.co.uk, gregkh@linuxfoundation.org,
straube.linux@gmail.com, fmdefrancesco@gmail.com,
saurav.girepunje@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Changcheng Deng <deng.changcheng@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] staging: r8188eu: remove unneeded variable
Date: Tue, 2 Nov 2021 11:23:58 +0300 [thread overview]
Message-ID: <e0c4a337-995e-2dce-1dbf-e0fe4b778455@gmail.com> (raw)
In-Reply-To: <20211102073226.7966-1-deng.changcheng@zte.com.cn>
On 11/2/21 10:32, cgel.zte@gmail.com wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
>
> Remove unneeded variable used to store return value.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
> ---
> drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index 995a0248c26f..98863a06bdb6 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -350,7 +350,6 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c
>
> int init_mlme_ext_priv(struct adapter *padapter)
> {
> - int res = _SUCCESS;
> struct registry_priv *pregistrypriv = &padapter->registrypriv;
> struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> @@ -373,7 +372,7 @@ int init_mlme_ext_priv(struct adapter *padapter)
>
> pmlmeext->active_keep_alive_check = true;
>
> - return res;
> + return _SUCCESS;
> }
Looks like it always return success, so, maybe, it should return just void?
>
> void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
> @@ -1611,7 +1610,6 @@ unsigned int OnAtim(struct adapter *padapter, struct recv_frame *precv_frame)
>
> unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_frame)
> {
> - unsigned int ret = _FAIL;
> struct sta_info *psta = NULL;
> struct sta_priv *pstapriv = &padapter->stapriv;
> u8 *pframe = precv_frame->rx_data;
> @@ -1644,7 +1642,7 @@ unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_f
> }
>
> exit:
> - return ret;
> + return _FAIL;
> }
>
> unsigned int OnAction_qos(struct adapter *padapter, struct recv_frame *precv_frame)
>
This looks odd from the beginning... Why return _FAIL even on success?
Anyway, nothing checks these handlers return values:
ptable = &OnAction_tbl[i];
if (category == ptable->num)
ptable->func(padapter, precv_frame);
So, it worth to make them void too, but, I guess, it's out of scope of
current patch
With regards,
Pavel Skripkin
next prev parent reply other threads:[~2021-11-02 8:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 7:32 [PATCH] staging: r8188eu: remove unneeded variable cgel.zte
2021-11-02 8:23 ` Pavel Skripkin [this message]
2021-11-05 13:41 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2021-11-09 11:53 cgel.zte
2021-11-09 12:09 ` Pavel Skripkin
2021-11-09 12:18 ` Dan Carpenter
2021-11-09 12:23 ` Pavel Skripkin
2021-11-10 8:12 ` Greg KH
2021-11-10 12:22 cgel.zte
2021-11-13 11:14 ` Greg KH
2021-11-12 13:18 cgel.zte
2021-11-12 16:31 ` Pavel Skripkin
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=e0c4a337-995e-2dce-1dbf-e0fe4b778455@gmail.com \
--to=paskripkin@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=cgel.zte@gmail.com \
--cc=deng.changcheng@zte.com.cn \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=saurav.girepunje@gmail.com \
--cc=straube.linux@gmail.com \
--cc=zealci@zte.com.cn \
/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