[U-Boot] [PATCH 3/3] ubifs: BUG: Blocks commpressed with zlib

Wolfgang Denk wd at denx.de
Mon Apr 27 21:46:25 CEST 2009


Dear Mike Frysinger,

In message <200904271200.39319.vapier at gentoo.org> you wrote:
>
> > > - * We need a wrapper for gunzip() because the parameters are
> > > + * We need a wrapper for zunzip() because the parameters are
> > >   * incompatible with the lzo decompressor.
> > >   */
> > >  static int gzip_decompress(const unsigned char *in, size_t in_len,
> > >  			   unsigned char *out, size_t *out_len)
> > >  {
> > >  	unsigned long len = in_len;
> > > -	return gunzip(out, *out_len, (unsigned char *)in, &len);
> > > +	return zunzip(out, *out_len, (unsigned char *)in, &len, 0, 0);
> > >  }
> >
> > If the only purpose of zunzip() is to be used here, then why do we not
> > make the parameters fit the intended purpose, thus avoiding an
> > additional wrapper?
> 
> not sure i follow ... what do you propose changing ?

The comment above seems to indicate that gzip_decompress() is only
(?) needed because the zunzip() parameters are incompatible with
those of the lzo decompressor.

So if we create zunzip() just for this purpose, then why  not  create
it  in a way that the parameters are compatible with those of the lzo
decompressor, so we can omit  this  whole  gzip_decompress()  wrapper
function?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The philosophy exam was a piece of cake  -  which  was  a  bit  of  a
surprise, actually, because I was expecting some questions on a sheet
of paper.


More information about the U-Boot mailing list