mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 白浩文 <baihaowen@meizu.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: "Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
	"phil@philpotter.co.uk" <phil@philpotter.co.uk>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"straube.linux@gmail.com" <straube.linux@gmail.com>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [PATCH] staging: r8188eu: Directly return instead of using local ret variable
Date: Mon, 28 Mar 2022 08:44:39 +0000	[thread overview]
Message-ID: <8eaea3ece1ee4452b4eb90774fca1cf4@meizu.com> (raw)
In-Reply-To: <20220328080817.4r5n5z375hzqaxjf@viti.kaiser.cx>

Thank you for your suggestion, resend again.
________________________________________
发件人: Martin Kaiser <martin@viti.kaiser.cx> 代表 Martin Kaiser <martin@kaiser.cx>
发送时间: 2022年3月28日 16:08:17
收件人: 白浩文
抄送: Larry.Finger@lwfinger.net; phil@philpotter.co.uk; gregkh@linuxfoundation.org; straube.linux@gmail.com; linux-staging@lists.linux.dev; linux-kernel@vger.kernel.org
主题: Re: [PATCH] staging: r8188eu: Directly return instead of using local ret variable

Thus wrote Haowen Bai (baihaowen@meizu.com):

> From: 白浩文 <baihaowen@meizu.com>

> fixes coccinelle warning:
> ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:1518:14-17: Unneeded variable: "ret".
>  Return "_FAIL" on line 1549
> ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:357:5-8: Unneeded variable: "res".
>  Return "_SUCCESS" on line 380

These are two unrelated changes. I guess you should split this into two
patches.

> Signed-off-by: 白浩文 <baihaowen@meizu.com>
> ---
>  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 10d5f12..4b7b0ee 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -354,7 +354,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;
> @@ -377,7 +376,7 @@ int       init_mlme_ext_priv(struct adapter *padapter)

>       pmlmeext->active_keep_alive_check = true;

> -     return res;
> +     return _SUCCESS;
>  }

The caller does not check the return value. You should change the
function to void init_mlme_ext_priv...

>  void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
> @@ -1515,7 +1514,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;
> @@ -1546,7 +1544,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)
> --
> 2.7.4


      reply	other threads:[~2022-03-28  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  1:41 Haowen Bai
2022-03-28  8:08 ` Martin Kaiser
2022-03-28  8:44   ` 白浩文 [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=8eaea3ece1ee4452b4eb90774fca1cf4@meizu.com \
    --to=baihaowen@meizu.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.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®