From 2a2d8e94ddc75c2c8d456e9163aa5dac510badcf Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 9 Oct 2021 09:28:21 -0600 Subject: lz4: Use a private header for U-Boot At present U-Boot has a header file called lz4.h for its own use. If the host has its own lz4 header file installed (e.g. from the 'liblz4-dev' package) then host builds will use that instead. Move the U-Boot file into its own directory, as is done with various other headers with the same problem. Signed-off-by: Simon Glass --- cmd/unlz4.c | 2 +- common/image.c | 2 +- include/lz4.h | 24 ------------------------ include/u-boot/lz4.h | 24 ++++++++++++++++++++++++ lib/lz4_wrapper.c | 2 +- test/compression.c | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 include/lz4.h create mode 100644 include/u-boot/lz4.h diff --git a/cmd/unlz4.c b/cmd/unlz4.c index 323ab46717..5f20838e89 100644 --- a/cmd/unlz4.c +++ b/cmd/unlz4.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) diff --git a/common/image.c b/common/image.c index 5b77113bea..3fa60b5827 100644 --- a/common/image.c +++ b/common/image.c @@ -61,7 +61,6 @@ DECLARE_GLOBAL_DATA_PTR; #include #include #include -#include #include #include #include @@ -71,6 +70,7 @@ DECLARE_GLOBAL_DATA_PTR; #include #include #include +#include static const table_entry_t uimage_arch[] = { { IH_ARCH_INVALID, "invalid", "Invalid ARCH", }, diff --git a/include/lz4.h b/include/lz4.h deleted file mode 100644 index 1276fb98a3..0000000000 --- a/include/lz4.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2019 Google LLC - */ - -#ifndef __LZ4_H -#define __LZ4_H - -/** - * ulz4fn() - Decompress LZ4 data - * - * @src: Source data to decompress - * @srcn: Length of source data - * @dst: Destination for uncompressed data - * @dstn: Returns length of uncompressed data - * @return 0 if OK, -EPROTONOSUPPORT if the magic number or version number are - * not recognised or independent blocks are used, -EINVAL if the reserved - * fields are non-zero, or input is overrun, -EENOBUFS if the destination - * buffer is overrun, -EEPROTO if the compressed data causes an error in - * the decompression algorithm - */ -int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); - -#endif diff --git a/include/u-boot/lz4.h b/include/u-boot/lz4.h new file mode 100644 index 0000000000..1276fb98a3 --- /dev/null +++ b/include/u-boot/lz4.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2019 Google LLC + */ + +#ifndef __LZ4_H +#define __LZ4_H + +/** + * ulz4fn() - Decompress LZ4 data + * + * @src: Source data to decompress + * @srcn: Length of source data + * @dst: Destination for uncompressed data + * @dstn: Returns length of uncompressed data + * @return 0 if OK, -EPROTONOSUPPORT if the magic number or version number are + * not recognised or independent blocks are used, -EINVAL if the reserved + * fields are non-zero, or input is overrun, -EENOBUFS if the destination + * buffer is overrun, -EEPROTO if the compressed data causes an error in + * the decompression algorithm + */ +int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); + +#endif diff --git a/lib/lz4_wrapper.c b/lib/lz4_wrapper.c index cdbcd05bd4..ebcb5c09a2 100644 --- a/lib/lz4_wrapper.c +++ b/lib/lz4_wrapper.c @@ -6,10 +6,10 @@ #include #include #include -#include #include #include #include +#include static u16 LZ4_readLE16(const void *src) { diff --git a/test/compression.c b/test/compression.c index 4cd1be564f..26d3c80fb5 100644 --- a/test/compression.c +++ b/test/compression.c @@ -9,11 +9,11 @@ #include #include #include -#include #include #include #include +#include #include #include -- cgit v1.2.3