Re: [PATCH -next 1/3] staging: vt6655: remove unused variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 14, 2021 at 05:01:24PM +0100, Greg KH wrote:
> On Sun, Mar 14, 2021 at 08:59:41AM -0600, Edmundo Carmona Antoranz wrote:
> > Since its introduction in 5449c685a4b3 (Staging: Add pristine
> > upstream vt6655 driver sources, 2009-04-25), the values
> > stored in variable byData have never been read in the macro
> > PCAvDelayByIO. By removing it, we are getting rid of a warning:
> > 
> > drivers/staging/vt6655/upc.h:45:16: warning: variable ‘byData’ set but not used [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Edmundo Carmona Antoranz <eantoranz@xxxxxxxxx>
> > ---
> >  drivers/staging/vt6655/upc.h | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h
> > index e086ec6e77f7..f00d0fd90003 100644
> > --- a/drivers/staging/vt6655/upc.h
> > +++ b/drivers/staging/vt6655/upc.h
> > @@ -42,14 +42,13 @@
> >  
> >  #define PCAvDelayByIO(uDelayUnit)				\
> >  do {								\
> > -	unsigned char byData;					\
> >  	unsigned long ii;					\
> >  								\
> >  	if (uDelayUnit <= 50) {					\
> >  		udelay(uDelayUnit);				\
> >  	} else {						\
> >  		for (ii = 0; ii < (uDelayUnit); ii++)		\
> > -			byData = inb(0x61);			\
> > +			inb(0x61);				\
> 
> Are you sure that the compiler does not make the inb() now go away?
> 

This is safe.  The compiler can't remove it.

regards,
dan carpenter




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux