From: Milton Miller Date: Fri, 21 Sep 2007 23:03:52 +0000 (+1000) Subject: [POWERPC] boot: Simplify gunzip_finish X-Git-Tag: v2.6.24-rc1~1450^2~158 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=51a505d73bfed863135861fdc0496a09766b69d5;p=linux-2.6-omap-h63xx.git [POWERPC] boot: Simplify gunzip_finish 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 Acked-by: David Gibson Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/boot/gunzip_util.c b/arch/powerpc/boot/gunzip_util.c index e1e215e1698..ef2aed0f63c 100644 --- a/arch/powerpc/boot/gunzip_util.c +++ b/arch/powerpc/boot/gunzip_util.c @@ -194,13 +194,10 @@ int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen) { 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;