From: GAURAV PATHAK <gauravpathak129@gmail.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: abbotti@mev.co.uk, gregkh@linuxfoundation.org,
hsweeten@visionengravers.com, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org
Subject: Re: [PATCH] Removing ununsed variable int lo, hi, int data and int i from comedi/drivers/dt2814.c.
Date: Sun, 24 May 2020 19:02:20 +0530 [thread overview]
Message-ID: <20200524133218.GA1391@xebrium.com> (raw)
In-Reply-To: <20200524121044.fzpm6hkqrrpa2yhc@ltop.local>
Nevermind, my sparse version was broken. Installed sparse 0.6.1, but
still no warnings from sparse in any of the directories in drivers staging.
E.g.:
make C=2 M=drivers/staging/sm750fb
CHECK drivers/staging/sm750fb/sm750.c
CHECK drivers/staging/sm750fb/sm750_hw.c
CHECK drivers/staging/sm750fb/sm750_accel.c
CHECK drivers/staging/sm750fb/sm750_cursor.c
CHECK drivers/staging/sm750fb/ddk750_chip.c
CHECK drivers/staging/sm750fb/ddk750_power.c
CHECK drivers/staging/sm750fb/ddk750_mode.c
CHECK drivers/staging/sm750fb/ddk750_display.c
CHECK drivers/staging/sm750fb/ddk750_swi2c.c
CHECK drivers/staging/sm750fb/ddk750_sii164.c
CHECK drivers/staging/sm750fb/ddk750_dvi.c
CHECK drivers/staging/sm750fb/ddk750_hwi2c.c
MODPOST 1 modules
For few drivers, I am getting:
CC [M] drivers/staging/vt6656/key.o
CHECK drivers/staging/vt6656/rf.c
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
./include/linux/stddef.h:17:9: this was the original definition
but I guess these are false positive, as #undef offsetof is already present in ./include/linux/stddef.h.
On Sun, May 24, 2020 at 02:10:44PM +0200, Luc Van Oostenryck wrote:
> Hi,
>
> On Sun, May 24, 2020 at 05:06:18PM +0530, Gaurav Pathak wrote:
> > Silence following sparse warning:
> > drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_interrupt’:
> > drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable]
> > int data;
> > ^~~~
> > drivers/staging/comedi/drivers/dt2814.c: In function ‘dt2814_attach’:
> > drivers/staging/comedi/drivers/dt2814.c:232:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
> > int i;
> > ^
>
> These warnings are not from sparse but simply from the compiler.
>
> > static irqreturn_t dt2814_interrupt(int irq, void *d)
> > {
> > - int lo, hi;
> > struct comedi_device *dev = d;
> > struct dt2814_private *devpriv = dev->private;
> > struct comedi_subdevice *s = dev->read_subdev;
> > - int data;
> >
> > if (!dev->attached) {
> > dev_err(dev->class_dev, "spurious interrupt\n");
> > return IRQ_HANDLED;
> > }
> >
> > - hi = inb(dev->iobase + DT2814_DATA);
> > - lo = inb(dev->iobase + DT2814_DATA);
> > -
> > - data = (hi << 4) | (lo >> 4);
>
> OK, 'data' is unused but are these 2 'inb(dev->iobase + DT2814_DATA)'
> needed or not? I would guess that they're needed but I don't know
> this hardware.
>
> > @@ -241,8 +233,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> > dev_err(dev->class_dev, "reset error (fatal)\n");
> > return -EIO;
> > }
> > - i = inb(dev->iobase + DT2814_DATA);
> > - i = inb(dev->iobase + DT2814_DATA);
>
> Same here.
>
> -- Luc
next prev parent reply other threads:[~2020-05-24 13:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-24 11:36 [PATCH] Removing ununsed variable int lo, hi, int data and int i from comedi/drivers/dt2814.c Gaurav Pathak
2020-05-24 12:10 ` Luc Van Oostenryck
2020-05-24 12:49 ` GAURAV PATHAK
2020-05-24 13:58 ` Luc Van Oostenryck
2020-05-24 13:32 ` GAURAV PATHAK [this message]
2020-05-24 14:08 ` Luc Van Oostenryck
2020-05-26 14:13 ` Dan Carpenter
2020-05-26 14:54 ` GAURAV PATHAK
2020-05-26 15:09 ` Dan Carpenter
2020-05-26 15:50 ` [PATCH v2] Staging: comedi: dt2814: remove unused assignments gaurav
2020-05-26 18:21 ` Dan Carpenter
2020-05-26 18:51 ` [PATCH v3] " Gaurav Pathak
2020-05-26 20:24 ` 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=20200524133218.GA1391@xebrium.com \
--to=gauravpathak129@gmail.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.vanoostenryck@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