driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Chen Wandun <chenwandun@huawei.com>
Cc: devel@driverdev.osuosl.org, kstewart@linuxfoundation.org,
	linux-kernel@vger.kernel.org, perex@perex.cz, joe@perches.com,
	tglx@linutronix.de, allison@lohutok.net
Subject: Re: [PATCH v2] hp100: remove set but not used variable val
Date: Tue, 5 Nov 2019 16:50:24 +0100	[thread overview]
Message-ID: <20191105155024.GA2677365@kroah.com> (raw)
In-Reply-To: <1572964619-76671-1-git-send-email-chenwandun@huawei.com>

On Tue, Nov 05, 2019 at 10:36:59PM +0800, Chen Wandun wrote:
> From: Chenwandun <chenwandun@huawei.com>
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/hp/hp100.c: In function hp100_start_xmit:
> drivers/staging/hp/hp100.c:1629:10: warning: variable val set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chenwandun <chenwandun@huawei.com>

I need a "full" name here, like the one on your email "From:" line.

> ---
>  drivers/staging/hp/hp100.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
> index 6ec78f5..6fc7733 100644
> --- a/drivers/staging/hp/hp100.c
> +++ b/drivers/staging/hp/hp100.c
> @@ -1626,7 +1626,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
>  	unsigned long flags;
>  	int i, ok_flag;
>  	int ioaddr = dev->base_addr;
> +#ifdef HP100_DEBUG_TX
>  	u_short val;
> +#endif

#ifdefs are not ok in .c code, sorry.

>  	struct hp100_private *lp = netdev_priv(dev);
>  
>  #ifdef HP100_DEBUG_B
> @@ -1695,7 +1697,9 @@ static netdev_tx_t hp100_start_xmit(struct sk_buff *skb,
>  
>  	spin_lock_irqsave(&lp->lock, flags);
>  	hp100_ints_off();
> +#ifdef HP100_DEBUG_TX
>  	val = hp100_inw(IRQ_STATUS);

Are you sure that this doesn't actually change the hardware in some way?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2019-11-05 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191105133554.6C01F9A06CB85816F399@huawei.com>
2019-11-05 14:36 ` [PATCH v2] hp100: remove set but not used variable val Chen Wandun
2019-11-05 14:43   ` Dan Carpenter
2019-11-05 15:50   ` Greg KH [this message]
2019-11-05 17:13     ` Joe Perches

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=20191105155024.GA2677365@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=allison@lohutok.net \
    --cc=chenwandun@huawei.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=joe@perches.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tglx@linutronix.de \
    /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).