From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 10 Jul 2007 17:08:32 -0500 (CDT) Subject: [PATCH 3/15] boot: simplfy gunzip_finish Sender: From: Milton Miller To: linuxppc-dev@ozlabs.org Message-Id: In-Reply-To: Cc: Paul Mackerras , David Gibson List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Call gunzip_partial to calculate the remaining length and copy the data to the user buffer. This makes it shorter and reduces duplication. Signed-off-by: Milton Miller --- Index: work.git/arch/powerpc/boot/gunzip_util.c =================================================================== --- work.git.orig/arch/powerpc/boot/gunzip_util.c 2007-07-10 03:47:35.000000000 -0500 +++ work.git/arch/powerpc/boot/gunzip_util.c 2007-07-10 03:47:39.000000000 -0500 @@ -194,13 +194,10 @@ int gunzip_finish(struct gunzip_state *s { int len; + len = gunzip_partial(state, dst, dstlen); + if (state->s.workspace) { - len = gunzip_partial(state, dst, dstlen); zlib_inflateEnd(&state->s); - } else { - /* uncompressed image */ - len = min(state->s.avail_in, (unsigned)dstlen); - memcpy(dst, state->s.next_in, len); } return len;