From 0c605a5a6cf0b5a7bdaa6068168581dc8fb24d22 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 1 Jul 2013 04:57:37 -0700 Subject: CBFS: Change the signature of cbfs_decompress. Instead of returning 0 on success and -1 on error, return the decompressed size of the data on success and 0 on error. The decompressed size is useful information to have that was being thrown away in that function. Change-Id: If787201aa61456b1e47feaf3a0071c753fa299a3 Signed-off-by: Gabe Black Reviewed-on: http://review.coreboot.org/3578 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/lib/cbfs_core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib/cbfs_core.c') diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c index 39c1ff6008..612fef2a6f 100644 --- a/src/lib/cbfs_core.c +++ b/src/lib/cbfs_core.c @@ -196,19 +196,16 @@ int cbfs_decompress(int algo, void *src, void *dst, int len) switch (algo) { case CBFS_COMPRESS_NONE: memmove(dst, src, len); - return 0; + return len; #ifdef CBFS_CORE_WITH_LZMA case CBFS_COMPRESS_LZMA: - if (ulzma(src, dst) != 0) { - return 0; - } - return -1; + return ulzma(src, dst); #endif default: ERROR("tried to decompress %d bytes with algorithm #%x," "but that algorithm id is unsupported.\n", len, algo); - return -1; + return 0; } } -- cgit v1.2.3