linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Haowen Bai <baihaowen@meizu.com>
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
	straube.linux@gmail.com, martin@kaiser.cx,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] staging: r8188eu: Directly return _SUCCESS instead of using local ret variable
Date: Mon, 28 Mar 2022 10:47:45 +0200	[thread overview]
Message-ID: <YkF2MRdxlUWow0UC@kroah.com> (raw)
In-Reply-To: <1648457028-4226-1-git-send-email-baihaowen@meizu.com>

On Mon, Mar 28, 2022 at 04:43:48PM +0800, Haowen Bai wrote:
> fixes coccinelle warning:
> ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:357:5-8: Unneeded variable: "res".
>  Return "_SUCCESS" on line 380
> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> V1->V2: split into two patches.
> 
>  drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index 931e6f2..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;

If a function can only ever succeed, why return anything?  Please make
this a function return void.

thanks,

greg k-h

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  8:43 [PATCH V2] staging: r8188eu: Directly return _SUCCESS instead of using local ret variable Haowen Bai
2022-03-28  8:47 ` Greg KH [this message]
2022-03-28  9:07   ` 答复: " 白浩文
2022-03-28  9:12     ` Greg KH
2022-03-29  9:59       ` baihaowen
2022-03-29 11:06         ` [PATCH] " Haowen Bai
2022-03-29 11:09           ` [PATCH V3] " Haowen Bai
2022-03-29 11:28             ` Dan Carpenter
2022-03-30  1:14               ` baihaowen
2022-03-30  1:28                 ` [PATCH V4] " Haowen Bai
2022-03-30  7:20                   ` Dan Carpenter
2022-03-29 11:26           ` [PATCH] " Dan Carpenter

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=YkF2MRdxlUWow0UC@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=baihaowen@meizu.com \
    --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;
as well as URLs for NNTP newsgroup(s).