All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Namrata A Shettar <namrataashettar@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>,
	Rithvik Patibandla <rithvikp98@gmail.com>,
	outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [PATCH] staging: vt6656: Remove unneccesary return variable
Date: Mon, 26 Sep 2016 13:23:53 +0200	[thread overview]
Message-ID: <20160926112353.GA4505@kroah.com> (raw)
In-Reply-To: <20160926111158.GA9984@namrata-HP-Pavilion-g6-Notebook-PC>

On Mon, Sep 26, 2016 at 04:42:03PM +0530, Namrata A Shettar wrote:
> Remove uneccessary return variable 'ret'. Return value directly.
> 
> Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
> ---
>  drivers/staging/vt6656/card.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
> index 53b469c..33de99a 100644
> --- a/drivers/staging/vt6656/card.c
> +++ b/drivers/staging/vt6656/card.c
> @@ -708,8 +708,6 @@ void vnt_update_next_tbtt(struct vnt_private *priv, u64 tsf,
>   */
>  int vnt_radio_power_off(struct vnt_private *priv)
>  {
> -	int ret = true;
> -
>  	switch (priv->rf_type) {
>  	case RF_AL2230:
>  	case RF_AL2230S:
> @@ -728,7 +726,7 @@ int vnt_radio_power_off(struct vnt_private *priv)
>  
>  	vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
>  
> -	return ret;
> +	return true;
>  }

If this function can never "fail", why return anything at all?  Just
make the function not return anything, it's not like the return value is
even checked.

>  
>  /*
> @@ -745,8 +743,6 @@ int vnt_radio_power_off(struct vnt_private *priv)
>   */
>  int vnt_radio_power_on(struct vnt_private *priv)
>  {
> -	int ret = true;
> -
>  	vnt_exit_deep_sleep(priv);
>  
>  	vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
> @@ -765,7 +761,7 @@ int vnt_radio_power_on(struct vnt_private *priv)
>  
>  	vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
>  
> -	return ret;
> +	return true;
>  }
i
Same here.

thanks,

greg k-h


  reply	other threads:[~2016-09-26 11:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 11:12 [PATCH] staging: vt6656: Remove unneccesary return variable Namrata A Shettar
2016-09-26 11:23 ` Greg Kroah-Hartman [this message]
2016-09-26 11:26   ` [Outreachy kernel] " Julia Lawall
2016-09-26 12:29     ` Namrata A Shettar
2016-09-26 14:31       ` Julia Lawall
2016-09-26 16:28         ` Namrata A Shettar
2016-09-26 16:29           ` Julia Lawall

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=20160926112353.GA4505@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=forest@alittletooquiet.net \
    --cc=namrataashettar@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=rithvikp98@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.