mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
[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:
parent
e47654d016
commit
51a505d73b
1 changed files with 2 additions and 5 deletions
|
@ -194,13 +194,10 @@ int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
len = gunzip_partial(state, dst, dstlen);
|
||||||
|
|
||||||
if (state->s.workspace) {
|
if (state->s.workspace) {
|
||||||
len = gunzip_partial(state, dst, dstlen);
|
|
||||||
zlib_inflateEnd(&state->s);
|
zlib_inflateEnd(&state->s);
|
||||||
} else {
|
|
||||||
/* uncompressed image */
|
|
||||||
len = min(state->s.avail_in, (unsigned)dstlen);
|
|
||||||
memcpy(dst, state->s.next_in, len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
|
Loading…
Reference in a new issue