浏览代码

[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>
Milton Miller 17 年之前
父节点
当前提交
51a505d73b
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      arch/powerpc/boot/gunzip_util.c

+ 2 - 5
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;