From mboxrd@z Thu Jan 1 00:00:00 1970 From: adrian.wenl at gmail.com Date: Sun, 25 Mar 2012 08:53:35 -0700 Subject: [U-Boot] [PATCH 4/6] lib: zlib: remove the limitation for cannot using 0 as start In-Reply-To: <1332690817-31759-1-git-send-email-adrian.wenl@gmail.com> References: <1332690817-31759-1-git-send-email-adrian.wenl@gmail.com> Message-ID: <1332690817-31759-5-git-send-email-adrian.wenl@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Lei Wen 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 --- lib/zlib/deflate.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/lib/zlib/deflate.c b/lib/zlib/deflate.c index 5c4022f..3f7de14 100644 --- a/lib/zlib/deflate.c +++ b/lib/zlib/deflate.c @@ -592,11 +592,8 @@ 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); s->strm = strm; /* just in case */ -- 1.7.5.4