Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
[oweals/u-boot.git] / lib / lz4_wrapper.c
index 0739663fca55fcbf4def101c6322bfd9bd51f096..1e1e8d508530d44d5e1eb8e3f68e6f5d28175877 100644 (file)
@@ -1,11 +1,12 @@
+// SPDX-License-Identifier: GPL 2.0+ OR BSD-3-Clause
 /*
  * Copyright 2015 Google Inc.
- *
- * SPDX-License-Identifier: GPL 2.0+ BSD-3-Clause
  */
 
 #include <common.h>
 #include <compiler.h>
+#include <image.h>
+#include <lz4.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 
@@ -24,8 +25,6 @@ typedef uint64_t U64;
 /* Unaltered (except removing unrelated code) from github.com/Cyan4973/lz4. */
 #include "lz4.c"       /* #include for inlining, do not link! */
 
-#define LZ4F_MAGIC 0x184D2204
-
 struct lz4_frame_header {
        u32 magic;
        union {
@@ -94,7 +93,9 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn)
        }
 
        while (1) {
-               struct lz4_block_header b = { .raw = le32_to_cpu(*(u32 *)in) };
+               struct lz4_block_header b;
+
+               b.raw = le32_to_cpu(*(u32 *)in);
                in += sizeof(struct lz4_block_header);
 
                if (in - src + b.size > srcn) {