lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 24 May 2020 19:02:20 +0530
From:   GAURAV PATHAK <gauravpathak129@...il.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     abbotti@....co.uk, gregkh@...uxfoundation.org,
        hsweeten@...ionengravers.com, linux-kernel@...r.kernel.org,
        devel@...verdev.osuosl.org
Subject: Re: [PATCH] Removing ununsed variable int lo, hi, int data and int i
 from comedi/drivers/dt2814.c.

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

Powered by blists - more mailing lists