[PATCH 3/15] boot: simplfy gunzip_finish

Milton Miller miltonm at bga.com
Sat Sep 22 09:03:52 EST 2007


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 at bga.com>
Acked-by: David Gibson <david at gibson.dropbear.id.au>
--- 
identical content to 12170, removed extra space in change log

Index: kernel/arch/powerpc/boot/gunzip_util.c
===================================================================
--- kernel.orig/arch/powerpc/boot/gunzip_util.c	2007-07-10 03:39:07.000000000 -0500
+++ kernel/arch/powerpc/boot/gunzip_util.c	2007-07-10 03:39:07.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;



More information about the Linuxppc-dev mailing list