Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51a505d7 authored by Milton Miller's avatar Milton Miller Committed by Paul Mackerras
Browse files

[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: default avatarMilton Miller <miltonm@bga.com>
Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e47654d0
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -194,13 +194,10 @@ int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
{
	int len;

	if (state->s.workspace) {
	len = gunzip_partial(state, dst, dstlen);

	if (state->s.workspace) {
		zlib_inflateEnd(&state->s);
	} else {
		/* uncompressed image */
		len = min(state->s.avail_in, (unsigned)dstlen);
		memcpy(dst, state->s.next_in, len);
	}

	return len;