[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 <miltonm@bga.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Milton Miller 2007-09-22 09:03:52 +10:00 committed by Paul Mackerras
parent e47654d016
commit 51a505d73b

View File

@ -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;