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  linux-cve-announce  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]
Message-ID: <20200524124919.GA6889@xebrium.com>
Date:   Sun, 24 May 2020 18:19:22 +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.

Thanks a lot for your reply.
I am trying to run sparse on drivers/staging directory,
but I am not getting any useful warnings.
Steps that I did:

- Referred https://www.kernel.org/doc/man-pages/linux-next.html to get
linux-next latest tag next-20200522.
- After that executed following commands:
	- make mrproper; make clean; make distclean
	- make defconfig
	- make menuconfig (Enabled all Staging Drivers with M)
	- make modules_prepare
	- make C=1 M=drivers/staging (Also tried individual directories
	  inside staging directory e.g. make C=1 M=drivers/staging/comedi/drivers)

I am not getting any warning, I have attached the output in text format.

Any pointers for finding warning using sparse in drivers/staging
directory will be helpful. I really appretiate your guidance in this
regard.

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

View attachment "sparse-check" of type "text/plain" (336291 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ