[U-Boot] [RFC PATCH 18/20] sandbox: Remove unused variable warnings

Mike Frysinger vapier at gentoo.org
Mon Sep 26 06:49:59 CEST 2011


On Friday, September 23, 2011 12:01:46 Simon Glass wrote:
> On Sat, Sep 17, 2011 at 5:25 PM, Mike Frysinger wrote:
> > On Saturday, September 17, 2011 12:48:57 Simon Glass wrote:
> >> There are a few variables set but not used - this marks these as unused
> >> for the compiler.
> > 
> > summary says "sandbox:" but i dont think this has anything to do with
> > sandbox. you're just using a newer compiler.
> > 
> >> --- a/common/cmd_mem.c
> >> +++ b/common/cmd_mem.c
> >> 
> >> -     ulong   addr, length, i, junk;
> >> +     ulong   addr, length, i, junk __attribute__((unused));
> > 
> > this one is tricky as we just want to read the value from the volatile
> > pointer.  i'm guessing do "*longp++;" just adds a different warning ?
> 
> Isn't that a nop?

if it's volatile, it shouldn't be

> Well I can just assign it to a different variable - I will use 'size'
> in my new patch set.

Marek Vasut posted a patch which dropped the assignment and it seems to not 
add any warnings

> >> --- a/common/cmd_nvedit.c
> >> +++ b/common/cmd_nvedit.c
> >> 
> >> -     int len;
> >> +     int len __attribute((unused));
> > 
> > this file though looks like we should just delete "len"
> 
> Yes, done. I don't use lint anyway.

he also posted a fix for this :)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110926/624ffbd9/attachment.pgp 


More information about the U-Boot mailing list