Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jffs2: drop unused model argument

The jffs2 compression framework provides a "model" argument when
compressing and decompressing, but the caller always passes in NULL
and the callees never use it. So punt this useless overhead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Mike Frysinger and committed by
David Woodhouse
088bd455 d0f7959e

+15 -22
+3 -3
fs/jffs2/compr.c
··· 103 103 spin_unlock(&jffs2_compressor_list_lock); 104 104 *datalen = orig_slen; 105 105 *cdatalen = orig_dlen; 106 - compr_ret = this->compress(data_in, output_buf, datalen, cdatalen, NULL); 106 + compr_ret = this->compress(data_in, output_buf, datalen, cdatalen); 107 107 spin_lock(&jffs2_compressor_list_lock); 108 108 this->usecount--; 109 109 if (!compr_ret) { ··· 152 152 spin_unlock(&jffs2_compressor_list_lock); 153 153 *datalen = orig_slen; 154 154 *cdatalen = orig_dlen; 155 - compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen, NULL); 155 + compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen); 156 156 spin_lock(&jffs2_compressor_list_lock); 157 157 this->usecount--; 158 158 if (!compr_ret) { ··· 220 220 if (comprtype == this->compr) { 221 221 this->usecount++; 222 222 spin_unlock(&jffs2_compressor_list_lock); 223 - ret = this->decompress(cdata_in, data_out, cdatalen, datalen, NULL); 223 + ret = this->decompress(cdata_in, data_out, cdatalen, datalen); 224 224 spin_lock(&jffs2_compressor_list_lock); 225 225 if (ret) { 226 226 printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
+2 -2
fs/jffs2/compr.h
··· 49 49 char *name; 50 50 char compr; /* JFFS2_COMPR_XXX */ 51 51 int (*compress)(unsigned char *data_in, unsigned char *cpage_out, 52 - uint32_t *srclen, uint32_t *destlen, void *model); 52 + uint32_t *srclen, uint32_t *destlen); 53 53 int (*decompress)(unsigned char *cdata_in, unsigned char *data_out, 54 - uint32_t cdatalen, uint32_t datalen, void *model); 54 + uint32_t cdatalen, uint32_t datalen); 55 55 int usecount; 56 56 int disabled; /* if set the compressor won't compress */ 57 57 unsigned char *compr_buf; /* used by size compr. mode */
+2 -2
fs/jffs2/compr_lzo.c
··· 42 42 } 43 43 44 44 static int jffs2_lzo_compress(unsigned char *data_in, unsigned char *cpage_out, 45 - uint32_t *sourcelen, uint32_t *dstlen, void *model) 45 + uint32_t *sourcelen, uint32_t *dstlen) 46 46 { 47 47 size_t compress_size; 48 48 int ret; ··· 67 67 } 68 68 69 69 static int jffs2_lzo_decompress(unsigned char *data_in, unsigned char *cpage_out, 70 - uint32_t srclen, uint32_t destlen, void *model) 70 + uint32_t srclen, uint32_t destlen) 71 71 { 72 72 size_t dl = destlen; 73 73 int ret;
+2 -4
fs/jffs2/compr_rtime.c
··· 31 31 /* _compress returns the compressed size, -1 if bigger */ 32 32 static int jffs2_rtime_compress(unsigned char *data_in, 33 33 unsigned char *cpage_out, 34 - uint32_t *sourcelen, uint32_t *dstlen, 35 - void *model) 34 + uint32_t *sourcelen, uint32_t *dstlen) 36 35 { 37 36 short positions[256]; 38 37 int outpos = 0; ··· 72 73 73 74 static int jffs2_rtime_decompress(unsigned char *data_in, 74 75 unsigned char *cpage_out, 75 - uint32_t srclen, uint32_t destlen, 76 - void *model) 76 + uint32_t srclen, uint32_t destlen) 77 77 { 78 78 short positions[256]; 79 79 int outpos = 0;
+4 -7
fs/jffs2/compr_rubin.c
··· 298 298 #if 0 299 299 /* _compress returns the compressed size, -1 if bigger */ 300 300 int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, 301 - uint32_t *sourcelen, uint32_t *dstlen, void *model) 301 + uint32_t *sourcelen, uint32_t *dstlen) 302 302 { 303 303 return rubin_do_compress(BIT_DIVIDER_MIPS, bits_mips, data_in, 304 304 cpage_out, sourcelen, dstlen); ··· 306 306 #endif 307 307 static int jffs2_dynrubin_compress(unsigned char *data_in, 308 308 unsigned char *cpage_out, 309 - uint32_t *sourcelen, uint32_t *dstlen, 310 - void *model) 309 + uint32_t *sourcelen, uint32_t *dstlen) 311 310 { 312 311 int bits[8]; 313 312 unsigned char histo[256]; ··· 386 387 387 388 static int jffs2_rubinmips_decompress(unsigned char *data_in, 388 389 unsigned char *cpage_out, 389 - uint32_t sourcelen, uint32_t dstlen, 390 - void *model) 390 + uint32_t sourcelen, uint32_t dstlen) 391 391 { 392 392 rubin_do_decompress(BIT_DIVIDER_MIPS, bits_mips, data_in, 393 393 cpage_out, sourcelen, dstlen); ··· 395 397 396 398 static int jffs2_dynrubin_decompress(unsigned char *data_in, 397 399 unsigned char *cpage_out, 398 - uint32_t sourcelen, uint32_t dstlen, 399 - void *model) 400 + uint32_t sourcelen, uint32_t dstlen) 400 401 { 401 402 int bits[8]; 402 403 int c;
+2 -4
fs/jffs2/compr_zlib.c
··· 68 68 69 69 static int jffs2_zlib_compress(unsigned char *data_in, 70 70 unsigned char *cpage_out, 71 - uint32_t *sourcelen, uint32_t *dstlen, 72 - void *model) 71 + uint32_t *sourcelen, uint32_t *dstlen) 73 72 { 74 73 int ret; 75 74 ··· 135 136 136 137 static int jffs2_zlib_decompress(unsigned char *data_in, 137 138 unsigned char *cpage_out, 138 - uint32_t srclen, uint32_t destlen, 139 - void *model) 139 + uint32_t srclen, uint32_t destlen) 140 140 { 141 141 int ret; 142 142 int wbits = MAX_WBITS;