public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Wang Hai <wanghai38@huawei.com>
Cc: sylphrenadin@gmail.com, c.cantanheide@gmail.com,
	navid.emamdoost@gmail.com, nishkadg.linux@gmail.com,
	mst@redhat.com, stephen@brennan.io, mchehab@kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192u: Remove some set but not used variables
Date: Mon, 6 Apr 2020 16:07:35 +0200	[thread overview]
Message-ID: <20200406140735.GA26701@kroah.com> (raw)
In-Reply-To: <1586261264-37576-1-git-send-email-wanghai38@huawei.com>

On Tue, Apr 07, 2020 at 08:07:44AM -0400, Wang Hai wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/rtl8192u/r8192U_core.c: In function rtl8192_hard_data_xmit:
> drivers/staging/rtl8192u/r8192U_core.c:905:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
> drivers/staging/rtl8192u/r8192U_core.c: In function rtl8192_commit:
> drivers/staging/rtl8192u/r8192U_core.c:3418:6: warning: variable ‘reset_status’ set but not used [-Wunused-but-set-variable]
> 
> Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index fcfb902..bb28670 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -902,7 +902,6 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
>  				   int rate)
>  {
>  	struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
> -	int ret;
>  	unsigned long flags;
>  	struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
>  	u8 queue_index = tcb_desc->queue_index;
> @@ -915,7 +914,7 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
>  	*(struct net_device **)(skb->cb) = dev;
>  	tcb_desc->bTxEnableFwCalcDur = 1;
>  	skb_push(skb, priv->ieee80211->tx_headroom);
> -	ret = rtl8192_tx(dev, skb);
> +	rtl8192_tx(dev, skb);

Shouldn't we do something about an error if that function returns an
error?  Why are we ignoring it?

>  
>  	spin_unlock_irqrestore(&priv->tx_lock, flags);
>  }
> @@ -3415,7 +3414,6 @@ int rtl8192_down(struct net_device *dev)
>  void rtl8192_commit(struct net_device *dev)
>  {
>  	struct r8192_priv *priv = ieee80211_priv(dev);
> -	int reset_status = 0;
>  
>  	if (priv->up == 0)
>  		return;
> @@ -3427,7 +3425,7 @@ void rtl8192_commit(struct net_device *dev)
>  	ieee80211_softmac_stop_protocol(priv->ieee80211);
>  
>  	rtl8192_rtx_disable(dev);
> -	reset_status = _rtl8192_up(dev);
> +	_rtl8192_up(dev);

Same here, should that really be ignored?

thanks,

greg k-h

      reply	other threads:[~2020-04-06 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 12:07 [PATCH] staging: rtl8192u: Remove some set but not used variables Wang Hai
2020-04-06 14:07 ` Greg KH [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=20200406140735.GA26701@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=c.cantanheide@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mst@redhat.com \
    --cc=navid.emamdoost@gmail.com \
    --cc=nishkadg.linux@gmail.com \
    --cc=stephen@brennan.io \
    --cc=sylphrenadin@gmail.com \
    --cc=wanghai38@huawei.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