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>
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 9c9e159..03c7ce9 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -144,7 +144,7 @@
#endif
#if defined(CONFIG_KM_COMMON_ETH_INIT)
-int board_eth_init(bd_t *bis)
+int board_eth_init(struct bd_info *bis)
{
if (ethernet_present())
return cpu_eth_init(bis);
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 75c558a..0aad452 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -257,7 +257,7 @@
return 0;
}
-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/keymile/kmp204x/eth.c b/board/keymile/kmp204x/eth.c
index 8635a54..29c5b33 100644
--- a/board/keymile/kmp204x/eth.c
+++ b/board/keymile/kmp204x/eth.c
@@ -11,7 +11,7 @@
#include <fsl_mdio.h>
#include <phy.h>
-int board_eth_init(bd_t *bis)
+int board_eth_init(struct bd_info *bis)
{
int ret = 0;
#ifdef CONFIG_FMAN_ENET
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index 21afbc7..29dde7a 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -222,7 +222,7 @@
}
#endif
-int ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, struct bd_info *bd)
{
phys_addr_t base;
phys_size_t size;
diff --git a/board/keymile/kmp204x/kmp204x.h b/board/keymile/kmp204x/kmp204x.h
index 00e1a06..3b858a5 100644
--- a/board/keymile/kmp204x/kmp204x.h
+++ b/board/keymile/kmp204x/kmp204x.h
@@ -5,4 +5,4 @@
*/
-void pci_of_setup(void *blob, bd_t *bd);
+void pci_of_setup(void *blob, struct bd_info *bd);
diff --git a/board/keymile/kmp204x/pci.c b/board/keymile/kmp204x/pci.c
index 87bf168..cdb498d 100644
--- a/board/keymile/kmp204x/pci.c
+++ b/board/keymile/kmp204x/pci.c
@@ -119,7 +119,7 @@
fsl_pcie_init_board(0);
}
-void pci_of_setup(void *blob, bd_t *bd)
+void pci_of_setup(void *blob, struct bd_info *bd)
{
FT_FSL_PCI_SETUP;
}