crc32: Use the crc.h header for crc functions
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:16 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:23:08 +0000 (18:23 -0500)
Drop inclusion of crc.h in common.h and use the correct header directly
instead.

With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
65 files changed:
api/api.c
arch/arm/mach-meson/board-common.c
arch/arm/mach-rockchip/misc.c
board/CZ.NIC/turris_omnia/turris_omnia.c
board/corscience/tricorder/tricorder-eeprom.c
board/freescale/common/sys_eeprom.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/gardena/smart-gateway-mt7688/board.c
board/gdsys/a38x/hre.c
board/gdsys/p1022/controlcenterd-id.c
board/sunxi/board.c
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/varisys/common/sys_eeprom.c
cmd/i2c.c
cmd/nvedit.c
common/android_ab.c
common/bloblist.c
common/board_r.c
common/hash.c
common/image-fit.c
common/image.c
common/iotrace.c
common/spl/spl.c
disk/part_efi.c
drivers/misc/atsha204a-i2c.c
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/crc32.c
drivers/mtd/ubi/eba.c
drivers/mtd/ubi/fastmap.c
drivers/mtd/ubi/io.c
drivers/mtd/ubi/vtbl.c
drivers/mtd/ubispl/ubispl.c
drivers/net/fm/fdt.c
drivers/net/fm/fm.c
drivers/qe/qe.c
env/common.c
env/eeprom.c
env/flash.c
env/nand.c
env/nvram.c
env/remote.c
env/sf.c
examples/api/glue.c
fs/jffs2/jffs2_1pass.c
fs/ubifs/io.c
fs/ubifs/recovery.c
fs/ubifs/tnc.c
include/common.h
lib/crc32.c
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_runtime.c
lib/efi_loader/efi_variable.c
lib/efi_selftest/efi_selftest_config_table.c
lib/efi_selftest/efi_selftest_crc32.c
lib/gunzip.c
lib/zlib/deflate.c
tools/default_image.c
tools/env/fw_env.c
tools/env/fw_env.h
tools/envcrc.c
tools/mkenvimage.c
tools/mxsimage.c
tools/pbl_crc32.c
tools/pblimage.c
tools/socfpgaimage.c

index 71fa038..4fc451a 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -13,6 +13,7 @@
 #include <env_internal.h>
 #include <linux/types.h>
 #include <api_public.h>
+#include <u-boot/crc.h>
 
 #include "api_private.h"
 
index d261b4e..6c77e37 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/armv8/mmu.h>
 #include <asm/unaligned.h>
 #include <efi_loader.h>
+#include <u-boot/crc.h>
 
 #if CONFIG_IS_ENABLED(FASTBOOT)
 #include <asm/psci.h>
index bed4317..f697e93 100644 (file)
@@ -14,6 +14,7 @@
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <misc.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha256.h>
 
 #include <asm/arch-rockchip/misc.h>
index 1d8d08a..4d21e62 100644 (file)
@@ -18,6 +18,7 @@
 #include <dm/uclass.h>
 #include <fdt_support.h>
 #include <time.h>
+#include <u-boot/crc.h>
 # include <atsha204a-i2c.h>
 
 #include "../drivers/ddr/marvell/a38x/ddr3_init.h"
index 16bceea..b28189d 100644 (file)
@@ -6,6 +6,7 @@
  */
 #include <common.h>
 #include <i2c.h>
+#include <u-boot/crc.h>
 
 #include "tricorder-eeprom.h"
 
index bb655ca..6f151b0 100644 (file)
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <i2c.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_SYS_I2C_EEPROM_CCID
 #include "../common/eeprom.h"
index e5aecc4..003e95c 100644 (file)
@@ -17,6 +17,7 @@
 #include <miiphy.h>
 #include <command.h>
 #include <linux/libfdt.h>
+#include <u-boot/crc.h>
 #if defined(CONFIG_PCI)
 #include <pci.h>
 #endif
index e9ffd42..fea823b 100644 (file)
@@ -10,6 +10,7 @@
 #include <net.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <u-boot/crc.h>
 #include <uuid.h>
 #include <linux/ctype.h>
 #include <linux/io.h>
index 82b8428..027ad1f 100644 (file)
@@ -10,6 +10,7 @@
 #include <i2c.h>
 #include <mmc.h>
 #include <tpm-v1.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha1.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
index 43f5404..d6798bd 100644 (file)
@@ -18,6 +18,7 @@
 #include <i2c.h>
 #include <mmc.h>
 #include <tpm-v1.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha1.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
index e3b2d13..b9450a0 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/spl.h>
+#include <u-boot/crc.h>
 #ifndef CONFIG_ARM64
 #include <asm/armv7.h>
 #endif
index 47259b7..9887d20 100644 (file)
@@ -9,6 +9,7 @@
 #include <misc.h>
 #include <spl.h>
 #include <syscon.h>
+#include <u-boot/crc.h>
 #include <usb.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
index 77772a6..4c02508 100644 (file)
@@ -15,6 +15,7 @@
 #include <env.h>
 #include <i2c.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 #include "eeprom.h"
 
index 038f97c..43a7629 100644 (file)
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -76,6 +76,7 @@
 #include <malloc.h>
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
+#include <u-boot/crc.h>
 
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
index 99a3bc5..b5da375 100644 (file)
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <malloc.h>
 #include <mapmem.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <linux/stddef.h>
 #include <asm/byteorder.h>
index 05ffc6f..6c4df41 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/err.h>
 #include <memalign.h>
 #include <u-boot/crc.h>
+#include <u-boot/crc.h>
 
 /**
  * Compute the CRC-32 of the bootloader control struct.
index b4cf169..ccf5e4b 100644 (file)
@@ -9,6 +9,7 @@
 #include <log.h>
 #include <mapmem.h>
 #include <spl.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index c9f476e..c0065a5 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <api.h>
+#include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
 #include <bedbug/type.h>
index d0d825e..ff4986a 100644 (file)
@@ -18,6 +18,7 @@
 #include <hw_sha.h>
 #include <asm/io.h>
 #include <linux/errno.h>
+#include <u-boot/crc.h>
 #else
 #include "mkimage.h"
 #include <time.h>
index 5c63c76..c52f945 100644 (file)
@@ -11,6 +11,7 @@
 #ifdef USE_HOSTCC
 #include "mkimage.h"
 #include <time.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compiler.h>
 #include <linux/kconfig.h>
index f17fa40..992ebba 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <env.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
index 5b92fab..ba955af 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <mapmem.h>
 #include <asm/io.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index f1ad8dc..cc5507f 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/u-boot.h>
 #include <nand.h>
 #include <fat.h>
+#include <u-boot/crc.h>
 #include <version.h>
 #include <image.h>
 #include <malloc.h>
index 51fa4a7..b2e157d 100644 (file)
@@ -19,6 +19,7 @@
 #include <part_efi.h>
 #include <linux/compiler.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 934ba5e..116c066 100644 (file)
@@ -15,6 +15,7 @@
 #include <i2c.h>
 #include <errno.h>
 #include <atsha204a-i2c.h>
+#include <u-boot/crc.h>
 
 #define ATSHA204A_TWLO                 60
 #define ATSHA204A_TRANSACTION_TIMEOUT  100000
index b4ba339..19defd8 100644 (file)
@@ -74,6 +74,7 @@
 #include <linux/slab.h>
 #include <linux/crc32.h>
 #include <linux/random.h>
+#include <u-boot/crc.h>
 #else
 #include <div64.h>
 #include <linux/err.h>
index 9c54ea4..9ce061c 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/compiler.h>
+#include <u-boot/crc.h>
 #endif
 #include <linux/types.h>
 
index 809782b..0c8b998 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/crc32.h>
+#include <u-boot/crc.h>
 #else
 #include <ubi_uboot.h>
 #endif
index 14368f9..646c778 100644 (file)
@@ -8,6 +8,7 @@
 
 #ifndef __UBOOT__
 #include <linux/crc32.h>
+#include <u-boot/crc.h>
 #else
 #include <div64.h>
 #include <malloc.h>
index 688fb50..608dede 100644 (file)
@@ -77,6 +77,7 @@
 #include <linux/crc32.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <hexdump.h>
 #include <ubi_uboot.h>
index fb535c1..9c46ef6 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <asm/div64.h>
+#include <u-boot/crc.h>
 #else
 #include <ubi_uboot.h>
 #endif
index 3f3b9b4..00102fc 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 #include <ubispl.h>
 
 #include <linux/crc32.h>
index 72d1294..a6b0d87 100644 (file)
@@ -5,6 +5,7 @@
 #include <asm/io.h>
 #include <env.h>
 #include <fsl_qe.h>    /* For struct qe_firmware */
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 /**
index 4c9dce8..926cf81 100644 (file)
@@ -8,6 +8,7 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <linux/errno.h>
+#include <u-boot/crc.h>
 
 #include "fm.h"
 #include <fsl_qe.h>            /* For struct qe_firmware */
index 6e4d732..24549ec 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/immap_qe.h>
 #include <fsl_qe.h>
 #include <mmc.h>
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_ARCH_LS1021A
 #include <asm/arch/immap_ls102xa.h>
index 4daaa6f..0edb6fb 100644 (file)
@@ -15,6 +15,7 @@
 #include <search.h>
 #include <errno.h>
 #include <malloc.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index cb04d2a..f0bdf2a 100644 (file)
@@ -12,6 +12,7 @@
 #include <env.h>
 #include <env_internal.h>
 #include <linux/stddef.h>
+#include <u-boot/crc.h>
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
 #include <i2c.h>
 #endif
index b94ed2b..b487e67 100644 (file)
@@ -17,6 +17,7 @@
 #include <malloc.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index e631bf2..8b0027d 100644 (file)
@@ -23,6 +23,7 @@
 #include <nand.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 #if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_NAND) && \
                !defined(CONFIG_SPL_BUILD)
index 79201bd..a78db21 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/stddef.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 55faa1e..50d77b8 100644 (file)
@@ -9,6 +9,7 @@
 #include <command.h>
 #include <env_internal.h>
 #include <linux/stddef.h>
+#include <u-boot/crc.h>
 
 #ifdef ENV_IS_EMBEDDED
 env_t *env_ptr = &environment;
index 16dba11..5ef4055 100644 (file)
--- a/env/sf.c
+++ b/env/sf.c
@@ -18,6 +18,7 @@
 #include <search.h>
 #include <errno.h>
 #include <dm/device-internal.h>
+#include <u-boot/crc.h>
 
 #ifndef CONFIG_SPL_BUILD
 #define CMD_SAVEENV
index 4086616..91d1315 100644 (file)
@@ -7,6 +7,7 @@
 #include <env.h>
 #include <linux/types.h>
 #include <api_public.h>
+#include <u-boot/crc.h>
 
 #include "glue.h"
 
index 6bf1943..5912cde 100644 (file)
 #include <linux/compiler.h>
 #include <linux/stat.h>
 #include <linux/time.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
index 8d7f8fe..7fe94e1 100644 (file)
@@ -61,6 +61,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compat.h>
 #include <linux/err.h>
index 621804c..b568012 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/err.h>
 #endif
index 86774f8..8afc08a 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compat.h>
 #include <linux/err.h>
index b09c7ae..9c454fb 100644 (file)
@@ -322,9 +322,6 @@ int strcmp_compar(const void *, const void *);
 /* lib/strmhz.c */
 char * strmhz(char *buf, unsigned long hz);
 
-/* lib/crc32.c */
-#include <u-boot/crc.h>
-
 /*
  * STDIO based functions (can always be used)
  */
index dc7e183..e9be3bf 100644 (file)
@@ -10,6 +10,7 @@
 
 #ifdef USE_HOSTCC
 #include <arpa/inet.h>
+#include <u-boot/crc.h>
 #else
 #include <common.h>
 #include <efi_loader.h>
index 493d906..ea52b95 100644 (file)
@@ -13,6 +13,7 @@
 #include <u-boot/crc.h>
 #include <bootm.h>
 #include <pe.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index ced0051..72555f0 100644 (file)
@@ -11,6 +11,7 @@
 #include <elf.h>
 #include <efi_loader.h>
 #include <rtc.h>
+#include <u-boot/crc.h>
 
 /* For manual relocation support */
 DECLARE_GLOBAL_DATA_PTR;
index 46f35bc..c316bdf 100644 (file)
@@ -11,6 +11,7 @@
 #include <hexdump.h>
 #include <malloc.h>
 #include <search.h>
+#include <u-boot/crc.h>
 
 #define READ_ONLY BIT(31)
 
index 4467f49..2bf12b5 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <efi_selftest.h>
+#include <u-boot/crc.h>
 
 static const struct efi_system_table *sys_table;
 static struct efi_boot_services *boottime;
index 4881e8a..19153c7 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <efi_selftest.h>
+#include <u-boot/crc.h>
 
 const struct efi_system_table *st;
 efi_status_t (EFIAPI *bs_crc32)(const void *data, efi_uintn_t data_size,
index 1d65616..9e6ccd6 100644 (file)
@@ -12,6 +12,7 @@
 #include <image.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <u-boot/zlib.h>
 
index 9a20b70..1fe58d5 100644 (file)
@@ -50,6 +50,7 @@
 /* @(#) $Id$ */
 
 #include "deflate.h"
+#include <u-boot/crc.h>
 
 const char deflate_copyright[] =
    " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
index f7990e2..e164c0c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>
 #include <tee/optee.h>
index e2801f5..30b5a19 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <dirent.h>
 
index 3d2b457..b60fbfc 100644 (file)
@@ -160,5 +160,3 @@ int fw_env_close(struct env_opts *opts);
  *  version string of the library
  */
 char *fw_env_version(void);
-
-unsigned long crc32(unsigned long, const unsigned char *, unsigned);
index 6e43608..bce7790 100644 (file)
@@ -9,6 +9,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 
 #include <linux/kconfig.h>
index a8eebab..b05f834 100644 (file)
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <libgen.h>
 #include <sys/types.h>
index 0bb5c6a..002f4b5 100644 (file)
@@ -11,6 +11,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <limits.h>
 
index 06da1d9..9b1ca55 100644 (file)
@@ -5,6 +5,7 @@
  * Cleaned up and refactored by Charles Manning.
  */
 #include "pblimage.h"
+#include <u-boot/crc.h>
 
 static uint32_t crc_table[256];
 static int crc_table_valid;
index d11f9af..3c823e9 100644 (file)
@@ -6,6 +6,7 @@
 #include <image.h>
 #include "pblimage.h"
 #include "pbl_crc32.h"
+#include <u-boot/crc.h>
 
 #define roundup(x, y)          ((((x) + ((y) - 1)) / (y)) * (y))
 #define PBL_ACS_CONT_CMD       0x81000000
index 72d8b96..8fa0983 100644 (file)
@@ -55,6 +55,7 @@
 #include "pbl_crc32.h"
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>