lz4: Use a private header for U-Boot
authorSimon Glass <sjg@chromium.org>
Sat, 9 Oct 2021 15:28:21 +0000 (09:28 -0600)
committerTom Rini <trini@konsulko.com>
Sat, 9 Oct 2021 17:09:56 +0000 (13:09 -0400)
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 <sjg@chromium.org>
cmd/unlz4.c
common/image.c
include/lz4.h [deleted file]
include/u-boot/lz4.h [new file with mode: 0644]
lib/lz4_wrapper.c
test/compression.c

index 323ab467173c8354e552910ff516178143c3f18e..5f20838e899c65109b22bfdd8b72d86083e1aa3a 100644 (file)
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
-#include <lz4.h>
+#include <u-boot/lz4.h>
 
 static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc,
                    char *const argv[])
index 5b77113bea3910a9c50aebc767678ee4089c5e78..3fa60b582796ae1065e22a4589bf59088a8e2094 100644 (file)
@@ -61,7 +61,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #include <display_options.h>
 #include <gzip.h>
 #include <image.h>
-#include <lz4.h>
 #include <imximage.h>
 #include <relocate.h>
 #include <linux/lzo.h>
@@ -71,6 +70,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #include <lzma/LzmaDec.h>
 #include <lzma/LzmaTools.h>
 #include <u-boot/crc.h>
+#include <u-boot/lz4.h>
 
 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 (file)
index 1276fb9..0000000
+++ /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 (file)
index 0000000..1276fb9
--- /dev/null
@@ -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
index cdbcd05bd4373e04f8ada97578a1eee4bb4b1638..ebcb5c09a22c73b0e132de5f2cfb8734f0ea62e1 100644 (file)
@@ -6,10 +6,10 @@
 #include <common.h>
 #include <compiler.h>
 #include <image.h>
-#include <lz4.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <asm/unaligned.h>
+#include <u-boot/lz4.h>
 
 static u16 LZ4_readLE16(const void *src)
 {
index 4cd1be564f3fdceb28678e80067b8fefdb8e0e29..26d3c80fb5ae618ed1c271c132f29d3154c7fc67 100644 (file)
@@ -9,11 +9,11 @@
 #include <gzip.h>
 #include <image.h>
 #include <log.h>
-#include <lz4.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <asm/io.h>
 
+#include <u-boot/lz4.h>
 #include <u-boot/zlib.h>
 #include <bzlib.h>