tree: git://git.cmpxchg.org/linux-mmotm.git master head: df25ba7db0775d87018e2cd92f26b9b087093840 commit: 0b3f61ac78013e35939696ddd63b9b871d11bf72 [188/230] initramfs: support initramfs that is more than 2G config: x86_64-randconfig-c3-0620 (attached as .config) All warnings: In file included from fs/jffs2/compr_zlib.c:19:0: fs/jffs2/compr_zlib.c: In function 'jffs2_zlib_compress': include/linux/kernel.h:713:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&_min1 == &_min2); \ ^ >> fs/jffs2/compr_zlib.c:97:23: note: in expansion of macro 'min' def_strm.avail_in = min((unsigned)(*sourcelen-def_strm.total_in), def_strm.avail_out); ^ fs/jffs2/compr_zlib.c:98:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uLong' [-Wformat=] jffs2_dbg(1, "calling deflate with avail_in %d, avail_out %d\n", ^ fs/jffs2/compr_zlib.c:98:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uLong' [-Wformat=] fs/jffs2/compr_zlib.c:101:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uLong' [-Wformat=] jffs2_dbg(1, "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", ^ fs/jffs2/compr_zlib.c:101:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uLong' [-Wformat=] vim +/min +97 fs/jffs2/compr_zlib.c ^1da177e Linus Torvalds 2005-04-16 13 #if !defined(__KERNEL__) && !defined(__ECOS) ^1da177e Linus Torvalds 2005-04-16 14 #error "The userspace support got too messy and was removed. Update your mkfs.jffs2" ^1da177e Linus Torvalds 2005-04-16 15 #endif ^1da177e Linus Torvalds 2005-04-16 16 5a528957 Joe Perches 2012-02-15 17 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 5a528957 Joe Perches 2012-02-15 18 ^1da177e Linus Torvalds 2005-04-16 @19 #include ^1da177e Linus Torvalds 2005-04-16 20 #include ^1da177e Linus Torvalds 2005-04-16 21 #include ^1da177e Linus Torvalds 2005-04-16 22 #include "nodelist.h" ^1da177e Linus Torvalds 2005-04-16 23 #include "compr.h" ^1da177e Linus Torvalds 2005-04-16 24 182ec4ee Thomas Gleixner 2005-11-07 25 /* Plan: call deflate() with avail_in == *sourcelen, 182ec4ee Thomas Gleixner 2005-11-07 26 avail_out = *dstlen - 12 and flush == Z_FINISH. ^1da177e Linus Torvalds 2005-04-16 27 If it doesn't manage to finish, call it again with ^1da177e Linus Torvalds 2005-04-16 28 avail_in == 0 and avail_out set to the remaining 12 182ec4ee Thomas Gleixner 2005-11-07 29 bytes for it to clean up. ^1da177e Linus Torvalds 2005-04-16 30 Q: Is 12 bytes sufficient? ^1da177e Linus Torvalds 2005-04-16 31 */ ^1da177e Linus Torvalds 2005-04-16 32 #define STREAM_END_SPACE 12 ^1da177e Linus Torvalds 2005-04-16 33 353ab6e9 Ingo Molnar 2006-03-26 34 static DEFINE_MUTEX(deflate_mutex); 353ab6e9 Ingo Molnar 2006-03-26 35 static DEFINE_MUTEX(inflate_mutex); ^1da177e Linus Torvalds 2005-04-16 36 static z_stream inf_strm, def_strm; ^1da177e Linus Torvalds 2005-04-16 37 ^1da177e Linus Torvalds 2005-04-16 38 #ifdef __KERNEL__ /* Linux-only */ ^1da177e Linus Torvalds 2005-04-16 39 #include ^1da177e Linus Torvalds 2005-04-16 40 #include 353ab6e9 Ingo Molnar 2006-03-26 41 #include ^1da177e Linus Torvalds 2005-04-16 42 ^1da177e Linus Torvalds 2005-04-16 43 static int __init alloc_workspaces(void) ^1da177e Linus Torvalds 2005-04-16 44 { 565d76cb Jim Keniston 2011-03-22 45 def_strm.workspace = vmalloc(zlib_deflate_workspacesize(MAX_WBITS, 565d76cb Jim Keniston 2011-03-22 46 MAX_MEM_LEVEL)); 045ead34 Joe Perches 2012-01-31 47 if (!def_strm.workspace) ^1da177e Linus Torvalds 2005-04-16 48 return -ENOMEM; 045ead34 Joe Perches 2012-01-31 49 9c261b33 Joe Perches 2012-02-15 50 jffs2_dbg(1, "Allocated %d bytes for deflate workspace\n", 9c261b33 Joe Perches 2012-02-15 51 zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL)); ^1da177e Linus Torvalds 2005-04-16 52 inf_strm.workspace = vmalloc(zlib_inflate_workspacesize()); ^1da177e Linus Torvalds 2005-04-16 53 if (!inf_strm.workspace) { ^1da177e Linus Torvalds 2005-04-16 54 vfree(def_strm.workspace); ^1da177e Linus Torvalds 2005-04-16 55 return -ENOMEM; ^1da177e Linus Torvalds 2005-04-16 56 } 9c261b33 Joe Perches 2012-02-15 57 jffs2_dbg(1, "Allocated %d bytes for inflate workspace\n", 9c261b33 Joe Perches 2012-02-15 58 zlib_inflate_workspacesize()); ^1da177e Linus Torvalds 2005-04-16 59 return 0; ^1da177e Linus Torvalds 2005-04-16 60 } ^1da177e Linus Torvalds 2005-04-16 61 ^1da177e Linus Torvalds 2005-04-16 62 static void free_workspaces(void) ^1da177e Linus Torvalds 2005-04-16 63 { ^1da177e Linus Torvalds 2005-04-16 64 vfree(def_strm.workspace); ^1da177e Linus Torvalds 2005-04-16 65 vfree(inf_strm.workspace); ^1da177e Linus Torvalds 2005-04-16 66 } ^1da177e Linus Torvalds 2005-04-16 67 #else ^1da177e Linus Torvalds 2005-04-16 68 #define alloc_workspaces() (0) ^1da177e Linus Torvalds 2005-04-16 69 #define free_workspaces() do { } while(0) ^1da177e Linus Torvalds 2005-04-16 70 #endif /* __KERNEL__ */ ^1da177e Linus Torvalds 2005-04-16 71 75c96f85 Adrian Bunk 2005-05-05 72 static int jffs2_zlib_compress(unsigned char *data_in, 75c96f85 Adrian Bunk 2005-05-05 73 unsigned char *cpage_out, 088bd455 Mike Frysinger 2010-09-22 74 uint32_t *sourcelen, uint32_t *dstlen) ^1da177e Linus Torvalds 2005-04-16 75 { ^1da177e Linus Torvalds 2005-04-16 76 int ret; ^1da177e Linus Torvalds 2005-04-16 77 ^1da177e Linus Torvalds 2005-04-16 78 if (*dstlen <= STREAM_END_SPACE) ^1da177e Linus Torvalds 2005-04-16 79 return -1; ^1da177e Linus Torvalds 2005-04-16 80 353ab6e9 Ingo Molnar 2006-03-26 81 mutex_lock(&deflate_mutex); ^1da177e Linus Torvalds 2005-04-16 82 ^1da177e Linus Torvalds 2005-04-16 83 if (Z_OK != zlib_deflateInit(&def_strm, 3)) { da320f05 Joe Perches 2012-02-15 84 pr_warn("deflateInit failed\n"); 353ab6e9 Ingo Molnar 2006-03-26 85 mutex_unlock(&deflate_mutex); ^1da177e Linus Torvalds 2005-04-16 86 return -1; ^1da177e Linus Torvalds 2005-04-16 87 } ^1da177e Linus Torvalds 2005-04-16 88 ^1da177e Linus Torvalds 2005-04-16 89 def_strm.next_in = data_in; ^1da177e Linus Torvalds 2005-04-16 90 def_strm.total_in = 0; 182ec4ee Thomas Gleixner 2005-11-07 91 ^1da177e Linus Torvalds 2005-04-16 92 def_strm.next_out = cpage_out; ^1da177e Linus Torvalds 2005-04-16 93 def_strm.total_out = 0; ^1da177e Linus Torvalds 2005-04-16 94 ^1da177e Linus Torvalds 2005-04-16 95 while (def_strm.total_out < *dstlen - STREAM_END_SPACE && def_strm.total_in < *sourcelen) { ^1da177e Linus Torvalds 2005-04-16 96 def_strm.avail_out = *dstlen - (def_strm.total_out + STREAM_END_SPACE); ^1da177e Linus Torvalds 2005-04-16 @97 def_strm.avail_in = min((unsigned)(*sourcelen-def_strm.total_in), def_strm.avail_out); 9c261b33 Joe Perches 2012-02-15 98 jffs2_dbg(1, "calling deflate with avail_in %d, avail_out %d\n", 9c261b33 Joe Perches 2012-02-15 99 def_strm.avail_in, def_strm.avail_out); ^1da177e Linus Torvalds 2005-04-16 100 ret = zlib_deflate(&def_strm, Z_PARTIAL_FLUSH); :::::: The code at line 97 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds :::::: CC: Linus Torvalds --- 0-DAY kernel build testing backend Open Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation