]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.jffs2: fix lzo usage on 64bit systems
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Mon, 23 Feb 2009 21:38:54 +0000 (22:38 +0100)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 24 Feb 2009 09:35:51 +0000 (11:35 +0200)
the compress size parameter in lzo is defined in the header file as lzo_uint.
This looks very much like uint32_t, I know, but is defined as unsigned long.
So on 64bit LE systems we zero some bytes near by and on BE systems we
get a size of zero.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
compr_lzo.c

index a0bb3621d327f5b62f7f929178b88bbb9b220877..3d7dad733d473768d1ad3d1529b8e239ec8dfe61 100644 (file)
@@ -48,7 +48,7 @@ static void *lzo_compress_buf;
 static int jffs2_lzo_cmpr(unsigned char *data_in, unsigned char *cpage_out,
                          uint32_t *sourcelen, uint32_t *dstlen, void *model)
 {
-       uint32_t compress_size;
+       lzo_uint compress_size;
        int ret;
 
        ret = lzo1x_999_compress(data_in, *sourcelen, lzo_compress_buf, &compress_size, lzo_mem);
@@ -69,7 +69,7 @@ static int jffs2_lzo_decompress(unsigned char *data_in, unsigned char *cpage_out
                                 uint32_t srclen, uint32_t destlen, void *model)
 {
        int ret;
-       uint32_t dl;
+       lzo_uint dl;
 
        ret = lzo1x_decompress_safe(data_in,srclen,cpage_out,&dl,NULL);