[U-Boot] [PATCH v2 13/25] lib/zlib: sparse fixes

Tom Rini trini at ti.com
Wed Nov 21 17:37:52 CET 2012


On Thu, Nov 08, 2012 at 07:06:31PM -0600, Kim Phillips wrote:
> On Thu, 8 Nov 2012 12:20:51 +0100
> Wolfgang Denk <wd at denx.de> wrote:
> 
> > In message <1351553687-12469-14-git-send-email-kim.phillips at freescale.com> you wrote:
> > > define Z_NULL to (void *)0 include/u-boot/zlib.h to get rid of most of
> > > the NULL pointer warnings.
> > ...
> > > -#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
> > > +#define Z_NULL  (void *)0  /* for initializing zalloc, zfree, opaque */
> > 
> > Don't we have to put parens around such an expression?
> 
> I suppose.
> 
> > > --- a/lib/zlib/adler32.c
> > > +++ b/lib/zlib/adler32.c
> > > @@ -54,10 +54,7 @@
> > >  #endif
> > >  
> > >  /* ========================================================================= */
> > > -uLong ZEXPORT adler32(adler, buf, len)
> > > -    uLong adler;
> > > -    const Bytef *buf;
> > > -    uInt len;
> > > +uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
> > 
> > Hm... this code has been imported from another project.  This
> > modification makes updates (or even comparing what has changed in more
> > recent versions) much mor difficult, or even impossible
> > :-(
> 
> my goal is to improve u-boot code quality by eliminating as much
> sparse noise as possible - most boards use this code to decompress
> kernels, so it's widely used.  E.g., this patch removes 52 lines of
> sparse output.  But ok, we can revert this patch and turn off
> checking for these files, in the form of an #ifndef __CHECKER__ at
> the top, with an 'imported from another project' justification
> comment.  Would that be better?

My memory could be faulty here, but can't we rely on the kernel here?
That'll give us sparse-clean zlib, or hints on how they're keeping it in
sync.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121121/bfd7e4e8/attachment.pgp>


More information about the U-Boot mailing list