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 <gabeblack@chromium.org>
Reviewed-on: http://review.coreboot.org/3578
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/payloads/libpayload/libcbfs/cbfs.c b/payloads/libpayload/libcbfs/cbfs.c
index 2fb91bf..6243473 100644
--- a/payloads/libpayload/libcbfs/cbfs.c
+++ b/payloads/libpayload/libcbfs/cbfs.c
@@ -120,7 +120,7 @@
if (! dest)
return src;
- if (cbfs_decompress(ntohl(orom->compression),
+ if (!cbfs_decompress(ntohl(orom->compression),
src,
dest,
ntohl(orom->len)))
@@ -146,7 +146,7 @@
stage->entry);
memset((void *) (uint32_t) stage->load, 0, stage->memlen);
- if (cbfs_decompress(stage->compression,
+ if (!cbfs_decompress(stage->compression,
((unsigned char *) stage) +
sizeof(struct cbfs_stage),
(void *) (uint32_t) stage->load,