1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Bootlin
5 * Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
12 #if IS_ENABLED(CONFIG_ZLIB)
13 #include <u-boot/zlib.h>
16 #include "sqfs_decompressor.h"
17 #include "sqfs_filesystem.h"
18 #include "sqfs_utils.h"
20 #if IS_ENABLED(CONFIG_ZLIB)
21 static void zlib_decompression_status(int ret)
25 printf("Error: 'dest' buffer is not large enough.\n");
28 printf("Error: corrupted compressed data.\n");
31 printf("Error: insufficient memory.\n");
37 int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
38 void *source, u32 lenp)
43 #if IS_ENABLED(CONFIG_ZLIB)
45 ret = uncompress(dest, dest_len, source, lenp);
47 zlib_decompression_status(ret);
54 printf("Error: unknown compression type.\n");