diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-06-26 09:13:33 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-07-17 16:30:13 +0300 |
commit | b75d8dc5642b71eb029e7cd38031a32029e736cc (patch) | |
tree | e13a2c309a27c528a79f7c49b468c0c2d246a499 /board/ti | |
parent | 02ff91e8c60f1f48bee8f4bd1c87ea0892cc5dae (diff) | |
download | u-boot-b75d8dc5642b71eb029e7cd38031a32029e736cc.tar.xz |
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/ti')
-rw-r--r-- | board/ti/am335x/board.c | 2 | ||||
-rw-r--r-- | board/ti/am3517crane/am3517crane.c | 2 | ||||
-rw-r--r-- | board/ti/am43xx/board.c | 2 | ||||
-rw-r--r-- | board/ti/am57xx/board.c | 6 | ||||
-rw-r--r-- | board/ti/am65x/evm.c | 2 | ||||
-rw-r--r-- | board/ti/beagle/beagle.c | 2 | ||||
-rw-r--r-- | board/ti/dra7xx/evm.c | 4 | ||||
-rw-r--r-- | board/ti/evm/evm.c | 6 | ||||
-rw-r--r-- | board/ti/j721e/evm.c | 2 | ||||
-rw-r--r-- | board/ti/ks2_evm/board.c | 4 | ||||
-rw-r--r-- | board/ti/ks2_evm/board_k2g.c | 2 | ||||
-rw-r--r-- | board/ti/omap5_uevm/evm.c | 4 | ||||
-rw-r--r-- | board/ti/panda/panda.c | 4 | ||||
-rw-r--r-- | board/ti/sdp4430/sdp.c | 4 | ||||
-rw-r--r-- | board/ti/ti816x/evm.c | 2 |
15 files changed, 24 insertions, 24 deletions
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 123ccaac44..984cc5e3ba 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -633,7 +633,7 @@ static struct clk_synth cdce913_data = { #define MAX_CPSW_SLAVES 2 /* At the moment, we do not want to stop booting for any failures here */ -int ft_board_setup(void *fdt, bd_t *bd) +int ft_board_setup(void *fdt, struct bd_info *bd) { const char *slave_path, *enet_name; int enetnode, slavenode, phynode; diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c index 888aa5b9ca..f32d1757db 100644 --- a/board/ti/am3517crane/am3517crane.c +++ b/board/ti/am3517crane/am3517crane.c @@ -64,7 +64,7 @@ void set_muxconf_regs(void) } #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 923b224e4c..de49590031 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -856,7 +856,7 @@ int board_usb_cleanup(int index, enum usb_init_type init) #endif /* !CONFIG_IS_ENABLED(DM_USB_GADGET) */ #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) { ft_cpu_setup(blob, bd); diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 511858a5e9..69dce70a60 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -898,7 +898,7 @@ err: #endif #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { omap_mmc_init(0, 0, 0, -1, -1); omap_mmc_init(1, 0, 0, -1, -1); @@ -1027,7 +1027,7 @@ static void u64_to_mac(u64 addr, u8 mac[6]) mac[0] = addr >> 40; } -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { int ret; uint8_t mac_addr[6]; @@ -1133,7 +1133,7 @@ int board_early_init_f(void) #endif #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) { ft_cpu_setup(blob, bd); diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index 20b75ba133..2eb8235c69 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -97,7 +97,7 @@ int board_fit_config_name_match(const char *name) #endif #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) { int ret; diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 9ccd566da3..6bd59eb10c 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -500,7 +500,7 @@ void set_muxconf_regs(void) } #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index acf7ff1691..5ae179f69b 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -920,7 +920,7 @@ err: #endif #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { omap_mmc_init(0, 0, 0, -1, -1); omap_mmc_init(1, 0, 0, -1, -1); @@ -1017,7 +1017,7 @@ int board_early_init_f(void) #endif #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) { ft_cpu_setup(blob, bd); diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index aba74fce77..193b3eb576 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -284,7 +284,7 @@ static void reset_net_chip(void) gpio_set_value(rst_gpio, 1); } -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { #if defined(CONFIG_SMC911X) env_set("ethaddr", NULL); @@ -296,7 +296,7 @@ int board_eth_init(bd_t *bis) #endif /* CONFIG_CMD_NET */ #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } @@ -308,7 +308,7 @@ void board_mmc_power_init(void) #endif /* CONFIG_MMC */ #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_CMD_NET) -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { return usb_eth_initialize(bis); } diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index ff939c8ca6..a1e8fe59c4 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -88,7 +88,7 @@ int board_fit_config_name_match(const char *name) #endif #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) { int ret; diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index 8595b20e87..c7be540028 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -93,7 +93,7 @@ u32 spl_boot_device(void) #endif #ifdef CONFIG_OF_BOARD_SETUP -int ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, struct bd_info *bd) { int lpae; char *env; @@ -145,7 +145,7 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } -void ft_board_setup_ex(void *blob, bd_t *bd) +void ft_board_setup_ex(void *blob, struct bd_info *bd) { int lpae; u64 size; diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index ece75326a5..a71024bcbc 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -223,7 +223,7 @@ s16 divn_val[16] = { }; #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { if (psc_enable_module(KS2_LPSC_MMC)) { printf("%s module enabled failed\n", __func__); diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c index 319bb6aa64..88f56edc54 100644 --- a/board/ti/omap5_uevm/evm.c +++ b/board/ti/omap5_uevm/evm.c @@ -161,7 +161,7 @@ int spl_start_uboot(void) } #endif /* CONFIG_SPL_OS_BOOT */ -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { return 0; } @@ -198,7 +198,7 @@ void set_muxconf_regs(void) } #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { omap_mmc_init(0, 0, 0, -1, -1); omap_mmc_init(1, 0, 0, -1, -1); diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 232d999a29..f718e69e85 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -61,7 +61,7 @@ int spl_start_uboot(void) } #endif /* CONFIG_SPL_OS_BOOT */ -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { return 0; } @@ -298,7 +298,7 @@ void set_muxconf_regs(void) } #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c index 5b294ea79b..3fd973049a 100644 --- a/board/ti/sdp4430/sdp.c +++ b/board/ti/sdp4430/sdp.c @@ -35,7 +35,7 @@ int board_init(void) return 0; } -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { return 0; } @@ -76,7 +76,7 @@ void set_muxconf_regs(void) } #if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) +int board_mmc_init(struct bd_info *bis) { omap_mmc_init(0, 0, 0, -1, -1); omap_mmc_init(1, 0, 0, -1, -1); diff --git a/board/ti/ti816x/evm.c b/board/ti/ti816x/evm.c index 590c15676a..becece1c20 100644 --- a/board/ti/ti816x/evm.c +++ b/board/ti/ti816x/evm.c @@ -33,7 +33,7 @@ int board_init(void) return 0; } -int board_eth_init(bd_t *bis) +int board_eth_init(struct bd_info *bis) { uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; |