diff options
author | Myles Watson <mylesgw@gmail.com> | 2009-10-09 15:22:35 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2009-10-09 15:22:35 +0000 |
commit | 86bf6795c3b1b537b5de07e3a5fca9faf4bd6073 (patch) | |
tree | 3fe03104feb5f1f8630391cc8459b53788d505c8 /src/lib | |
parent | 00f0267f7805f6d27d78c1ed586ac0f13c90637b (diff) | |
download | coreboot-86bf6795c3b1b537b5de07e3a5fca9faf4bd6073.tar.xz |
Move the ulzma prototype out of the function to make the code easier to read.
Check the return value. Minor formatting and LAR -> CBFS.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4752 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cbfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index ad45ece95a..780d69f488 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -29,6 +29,8 @@ #define ntohl(x) (x) #endif +unsigned long ulzma(unsigned char *src, unsigned char *dst); + int cbfs_decompress(int algo, void *src, void *dst, int len) { switch(algo) { @@ -36,15 +38,15 @@ int cbfs_decompress(int algo, void *src, void *dst, int len) memcpy(dst, src, len); return 0; - case CBFS_COMPRESS_LZMA: { - unsigned long ulzma(unsigned char *src, unsigned char *dst); - ulzma(src, dst); - } + case CBFS_COMPRESS_LZMA: + if (!ulzma(src, dst)) { + printk_err("CBFS: LZMA decompression failed!\n"); + return -1; + } return 0; default: - printk_info( "CBFS: Unknown compression type %d\n", - algo); + printk_info( "CBFS: Unknown compression type %d\n", algo); return -1; } } |