diff mbox

[U-Boot,V2,4/6] lib: zlib: remove the limitation for cannot using 0 as start

Message ID 1348842407-20355-5-git-send-email-leiwen@marvell.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Lei Wen Sept. 28, 2012, 2:26 p.m. UTC
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>
---
Changelog:
No change

 lib/zlib/deflate.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c
index 5c4022f..9a20b70 100644
--- a/lib/zlib/deflate.c
+++ b/lib/zlib/deflate.c
@@ -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);