Skip to content

Commit

Permalink
crc32: Use the crc.h header for crc functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Dec 2, 2019
1 parent b2ea91b commit 3db7110
Show file tree
Hide file tree
Showing 65 changed files with 63 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-meson/board-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-rockchip/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions board/CZ.NIC/turris_omnia/turris_omnia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions board/corscience/tricorder/tricorder-eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include <common.h>
#include <i2c.h>
#include <u-boot/crc.h>

#include "tricorder-eeprom.h"

Expand Down
1 change: 1 addition & 0 deletions board/freescale/common/sys_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc8323erdb/mpc8323erdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions board/gardena/smart-gateway-mt7688/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions board/gdsys/a38x/hre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions board/gdsys/p1022/controlcenterd-id.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions board/sunxi/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions board/theobroma-systems/puma_rk3399/puma-rk3399.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions board/varisys/common/sys_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <env.h>
#include <i2c.h>
#include <linux/ctype.h>
#include <u-boot/crc.h>

#include "eeprom.h"

Expand Down
1 change: 1 addition & 0 deletions cmd/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions cmd/nvedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions common/android_ab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions common/bloblist.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <log.h>
#include <mapmem.h>
#include <spl.h>
#include <u-boot/crc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down
1 change: 1 addition & 0 deletions common/board_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions common/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions common/image-fit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions common/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions common/iotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <common.h>
#include <mapmem.h>
#include <asm/io.h>
#include <u-boot/crc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down
1 change: 1 addition & 0 deletions common/spl/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions disk/part_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions drivers/misc/atsha204a-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/eba.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/fastmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#ifndef __UBOOT__
#include <linux/crc32.h>
#include <u-boot/crc.h>
#else
#include <div64.h>
#include <malloc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubi/vtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/ubispl/ubispl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <common.h>
#include <errno.h>
#include <u-boot/crc.h>
#include <ubispl.h>

#include <linux/crc32.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/net/fm/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down
1 change: 1 addition & 0 deletions drivers/net/fm/fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/qe/qe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions env/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <search.h>
#include <errno.h>
#include <malloc.h>
#include <u-boot/crc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down
1 change: 1 addition & 0 deletions env/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions env/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <malloc.h>
#include <search.h>
#include <errno.h>
#include <u-boot/crc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down
1 change: 1 addition & 0 deletions env/nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions env/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/stddef.h>
#include <search.h>
#include <errno.h>
#include <u-boot/crc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down
1 change: 1 addition & 0 deletions env/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions env/sf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/api/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <env.h>
#include <linux/types.h>
#include <api_public.h>
#include <u-boot/crc.h>

#include "glue.h"

Expand Down
1 change: 1 addition & 0 deletions fs/jffs2/jffs2_1pass.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
#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>
Expand Down
1 change: 1 addition & 0 deletions fs/ubifs/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions fs/ubifs/tnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down
1 change: 1 addition & 0 deletions lib/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#ifdef USE_HOSTCC
#include <arpa/inet.h>
#include <u-boot/crc.h>
#else
#include <common.h>
#include <efi_loader.h>
Expand Down
Loading

0 comments on commit 3db7110

Please sign in to comment.