]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/commitdiff
lib: zlib: remove the limitation for cannot using 0 as start
authorLei Wen <adrian.wenl@gmail.com>
Fri, 28 Sep 2012 04:26:45 +0000 (04:26 +0000)
committerTom Rini <trini@ti.com>
Sat, 29 Sep 2012 14:26:08 +0000 (07:26 -0700)
We often need the requirement that compressing those memory range start
from 0, but the default deflate code in zlib prevent us to do this.
Considering the special case of uboot, that it could access all memory
range, it is reasonable to be able to also take the address space from 0
into compression.

Signed-off-by: Lei Wen <leiwen@marvell.com>
lib/zlib/deflate.c

index 5c4022f3d4774b98bb22104890b04a7d3f7f4aec..9a20b7034483c32cdc528f2c14277796f1f1d09d 100644 (file)
@@ -592,9 +592,7 @@ int ZEXPORT deflate (strm, flush)
     }
     s = strm->state;
 
-    if (strm->next_out == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
-        (s->status == FINISH_STATE && flush != Z_FINISH)) {
+    if (s->status == FINISH_STATE && flush != Z_FINISH) {
         ERR_RETURN(strm, Z_STREAM_ERROR);
     }
     if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);