diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-06-26 15:13:33 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-07-17 09:30:13 -0400 |
commit | b75d8dc5642b71eb029e7cd38031a32029e736cc (patch) | |
tree | e13a2c309a27c528a79f7c49b468c0c2d246a499 /board/toradex | |
parent | 02ff91e8c60f1f48bee8f4bd1c87ea0892cc5dae (diff) | |
download | u-boot-b75d8dc5642b71eb029e7cd38031a32029e736cc.tar.gz u-boot-b75d8dc5642b71eb029e7cd38031a32029e736cc.tar.xz u-boot-b75d8dc5642b71eb029e7cd38031a32029e736cc.zip |
treewide: convert bd_t to struct bd_info by coccinelle
The Linux coding style guide (Documentation/process/coding-style.rst)
clearly says:
It's a **mistake** to use typedef for structures and pointers.
Besides, using typedef for structures is annoying when you try to make
headers self-contained.
Let's say you have the following function declaration in a header:
void foo(bd_t *bd);
This is not self-contained since bd_t is not defined.
To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h>
#include <asm/u-boot.h>
void foo(bd_t *bd);
Then, the include direcective pulls in more bloat needlessly.
If you use 'struct bd_info' instead, it is enough to put a forward
declaration as follows:
struct bd_info;
void foo(struct bd_info *bd);
Right, typedef'ing bd_t is a mistake.
I used coccinelle to generate this commit.
The semantic patch that makes this change is as follows:
<smpl>
@@
typedef bd_t;
@@
-bd_t
+struct bd_info
</smpl>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/apalis-imx8/apalis-imx8.c | 2 | ||||
-rw-r--r-- | board/toradex/apalis-tk1/apalis-tk1.c | 2 | ||||
-rw-r--r-- | board/toradex/apalis_imx6/apalis_imx6.c | 4 | ||||
-rw-r--r-- | board/toradex/apalis_t30/apalis_t30.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri-imx6ull/colibri-imx6ull.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri-imx8x/colibri-imx8x.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri_imx6/colibri_imx6.c | 4 | ||||
-rw-r--r-- | board/toradex/colibri_imx7/colibri_imx7.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri_pxa270/colibri_pxa270.c | 6 | ||||
-rw-r--r-- | board/toradex/colibri_t20/colibri_t20.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri_t30/colibri_t30.c | 2 | ||||
-rw-r--r-- | board/toradex/colibri_vf/colibri_vf.c | 2 | ||||
-rw-r--r-- | board/toradex/common/tdx-common.c | 4 | ||||
-rw-r--r-- | board/toradex/common/tdx-common.h | 2 | ||||
-rw-r--r-- | board/toradex/verdin-imx8mm/verdin-imx8mm.c | 2 |
15 files changed, 20 insertions, 20 deletions
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 8c4af7da8d..9263b0f51f 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -99,7 +99,7 @@ void reset_cpu(ulong addr) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c index d77b4c4ab9..e7a2186c2c 100644 --- a/board/toradex/apalis-tk1/apalis-tk1.c +++ b/board/toradex/apalis-tk1/apalis-tk1.c @@ -84,7 +84,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 40c71adf51..3961c4df9e 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -361,7 +361,7 @@ int board_mmc_getcd(struct mmc *mmc) return ret; } -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { struct src *psrc = (struct src *)SRC_BASE_ADDR; unsigned reg = readl(&psrc->sbmr1) >> 11; @@ -768,7 +768,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index 3e8b8b1fe3..f718dc855d 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -51,7 +51,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c index c67d02f7c2..55e2b5f05d 100644 --- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c +++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c @@ -214,7 +214,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { #if defined(CONFIG_FDT_FIXUP_PARTITIONS) static struct node_info nodes[] = { diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index e4d762f5df..f981c11a37 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -111,7 +111,7 @@ void reset_cpu(ulong addr) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 6522af416a..a416b5e54b 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -310,7 +310,7 @@ int board_mmc_getcd(struct mmc *mmc) return ret; } -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { struct src *psrc = (struct src *)SRC_BASE_ADDR; unsigned reg = readl(&psrc->sbmr1) >> 11; @@ -652,7 +652,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { u32 cma_size; diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 8df925dacf..26c285d88c 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -292,7 +292,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { #if defined(CONFIG_IMX_BOOTAUX) && defined(CONFIG_ARCH_FIXUP_FDT_MEMORY) int up; diff --git a/board/toradex/colibri_pxa270/colibri_pxa270.c b/board/toradex/colibri_pxa270/colibri_pxa270.c index 4c21731eed..273a17f608 100644 --- a/board/toradex/colibri_pxa270/colibri_pxa270.c +++ b/board/toradex/colibri_pxa270/colibri_pxa270.c @@ -51,7 +51,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } @@ -115,7 +115,7 @@ void usb_board_stop(void) #endif #ifdef CONFIG_DRIVER_DM9000 -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { return dm9000_initialize(bis); } @@ -123,7 +123,7 @@ int board_eth_init(bd_t *bis) #ifdef CONFIG_CMD_MMC #if !CONFIG_IS_ENABLED(DM_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { pxa_mmc_register(0); return 0; diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c index cb0aed872f..f44ca90ce9 100644 --- a/board/toradex/colibri_t20/colibri_t20.c +++ b/board/toradex/colibri_t20/colibri_t20.c @@ -78,7 +78,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c index 0bbe81e44d..c5562f6d57 100644 --- a/board/toradex/colibri_t30/colibri_t30.c +++ b/board/toradex/colibri_t30/colibri_t30.c @@ -34,7 +34,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return ft_common_board_setup(blob, bd); } diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index 92c5dbfc5a..7194ede01c 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -430,7 +430,7 @@ int checkboard(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { #ifndef CONFIG_DM_VIDEO int ret = 0; diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index e8de923f3e..3a3cfc8821 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -125,7 +125,7 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) #endif #if defined(CONFIG_OF_LIBFDT) -int ft_common_board_setup(void *blob, bd_t *bd) +int ft_common_board_setup(void *blob, struct bd_info *bd) { if (tdx_serial) { fdt_setprop(blob, 0, "serial-number", tdx_serial_str, @@ -162,7 +162,7 @@ u32 get_board_serial(void) } #endif /* CONFIG_SERIAL_TAG */ -int ft_common_board_setup(void *blob, bd_t *bd) +int ft_common_board_setup(void *blob, struct bd_info *bd) { return 0; } diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h index c537dca71e..81375de598 100644 --- a/board/toradex/common/tdx-common.h +++ b/board/toradex/common/tdx-common.h @@ -9,6 +9,6 @@ #define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000 #define TDX_USB_VID 0x1B67 -int ft_common_board_setup(void *blob, bd_t *bd); +int ft_common_board_setup(void *blob, struct bd_info *bd); #endif /* _TDX_COMMON_H */ diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index fa51b776ab..66950ed218 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -110,7 +110,7 @@ int board_late_init(void) } #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { return 0; } |