From: Wolfgang Denk Date: Mon, 27 Apr 2009 14:36:55 +0200 Subject: [U-Boot] [PATCH 3/3] ubifs: BUG: Blocks commpressed with zlib In-Reply-To: <1240831297-15862-3-git-send-email-ricardo.ribalda@uam.es> References: <1240831297-15862-1-git-send-email-ricardo.ribalda@uam.es> <1240831297-15862-2-git-send-email-ricardo.ribalda@uam.es> <1240831297-15862-3-git-send-email-ricardo.ribalda@uam.es> Message-ID: <20090427123655.ADF4D83420E8@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ricardo Ribalda Delgado, In message <1240831297-15862-3-git-send-email-ricardo.ribalda@uam.es> you wrote: > Blocks compressed with zlib dont have the full gzip header. > > Without this patch, block compressed with zlib cannot be readed! > > Signed-off-by: Ricardo Ribalda Delgado ... > #include "ubifs.h" > +#include > > #if !defined(CONFIG_SYS_64BIT_VSPRINTF) > #warning Please define CONFIG_SYS_64BIT_VSPRINTF for correct output! > @@ -33,15 +34,17 @@ DECLARE_GLOBAL_DATA_PTR; > > /* compress.c */ > > +int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp, > + int stoponerr, int offset); The prototype declaration should be in the neader file. Please remove here. > - * 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? 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 panic: kernel trap (ignored)