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/include/fdt_support.h b/include/fdt_support.h
index 2eff311..b1543b5 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -22,9 +22,9 @@
*/
int arch_fixup_fdt(void *blob);
-void ft_cpu_setup(void *blob, bd_t *bd);
+void ft_cpu_setup(void *blob, struct bd_info *bd);
-void ft_pci_setup(void *blob, bd_t *bd);
+void ft_pci_setup(void *blob, struct bd_info *bd);
u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
const char *prop, const u32 dflt);
@@ -137,9 +137,9 @@
int fdt_fixup_display(void *blob, const char *path, const char *display);
#if defined(CONFIG_USB_EHCI_FSL) || defined(CONFIG_USB_XHCI_FSL)
-void fsl_fdt_fixup_dr_usb(void *blob, bd_t *bd);
+void fsl_fdt_fixup_dr_usb(void *blob, struct bd_info *bd);
#else
-static inline void fsl_fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
+static inline void fsl_fdt_fixup_dr_usb(void *blob, struct bd_info *bd) {}
#endif /* defined(CONFIG_USB_EHCI_FSL) || defined(CONFIG_USB_XHCI_FSL) */
#if defined(CONFIG_SYS_FSL_SEC_COMPAT)
@@ -183,7 +183,7 @@
* @param bd_t Pointer to board data
* @return 0 if ok, or -FDT_ERR_... on error
*/
-int ft_board_setup(void *blob, bd_t *bd);
+int ft_board_setup(void *blob, struct bd_info *bd);
/*
* The keystone2 SOC requires all 32 bit aliased addresses to be converted
@@ -191,9 +191,9 @@
* are added or modified by the image_setup_libfdt(). The ft_board_setup_ex()
* called at the end of the image_setup_libfdt() is to do that convertion.
*/
-void ft_board_setup_ex(void *blob, bd_t *bd);
-void ft_cpu_setup(void *blob, bd_t *bd);
-void ft_pci_setup(void *blob, bd_t *bd);
+void ft_board_setup_ex(void *blob, struct bd_info *bd);
+void ft_cpu_setup(void *blob, struct bd_info *bd);
+void ft_pci_setup(void *blob, struct bd_info *bd);
/**
* Add system-specific data to the FDT before booting the OS.
@@ -205,7 +205,7 @@
* @param bd_t Pointer to board data
* @return 0 if ok, or -FDT_ERR_... on error
*/
-int ft_system_setup(void *blob, bd_t *bd);
+int ft_system_setup(void *blob, struct bd_info *bd);
void set_working_fdt_addr(ulong addr);
diff --git a/include/fm_eth.h b/include/fm_eth.h
index 729ad63..44da014 100644
--- a/include/fm_eth.h
+++ b/include/fm_eth.h
@@ -199,10 +199,10 @@
char *name;
};
-int fm_tgec_mdio_init(bd_t *bis, struct tgec_mdio_info *info);
-int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info);
+int fm_tgec_mdio_init(struct bd_info *bis, struct tgec_mdio_info *info);
+int fm_memac_mdio_init(struct bd_info *bis, struct memac_mdio_info *info);
-int fm_standard_init(bd_t *bis);
+int fm_standard_init(struct bd_info *bis);
void fman_enet_init(void);
void fdt_fixup_fman_ethernet(void *fdt);
phy_interface_t fm_info_get_enet_if(enum fm_port port);
diff --git a/include/fsl-mc/fsl_mc.h b/include/fsl-mc/fsl_mc.h
index 6cbcd39..a8b072a 100644
--- a/include/fsl-mc/fsl_mc.h
+++ b/include/fsl-mc/fsl_mc.h
@@ -62,7 +62,7 @@
#endif
u64 mc_get_dram_addr(void);
unsigned long mc_get_dram_block_size(void);
-int fsl_mc_ldpaa_init(bd_t *bis);
-int fsl_mc_ldpaa_exit(bd_t *bd);
+int fsl_mc_ldpaa_init(struct bd_info *bis);
+int fsl_mc_ldpaa_exit(struct bd_info *bd);
void mc_env_boot(void);
#endif
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index e148eaa..2615d1a 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -204,16 +204,16 @@
#endif
#ifdef CONFIG_FSL_ESDHC
-int fsl_esdhc_mmc_init(bd_t *bis);
-int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg);
-void fdt_fixup_esdhc(void *blob, bd_t *bd);
+int fsl_esdhc_mmc_init(struct bd_info *bis);
+int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg);
+void fdt_fixup_esdhc(void *blob, struct bd_info *bd);
#ifdef MMC_SUPPORTS_TUNING
static inline int fsl_esdhc_execute_tuning(struct udevice *dev,
uint32_t opcode) {return 0; }
#endif
#else
-static inline int fsl_esdhc_mmc_init(bd_t *bis) { return -ENOSYS; }
-static inline void fdt_fixup_esdhc(void *blob, bd_t *bd) {}
+static inline int fsl_esdhc_mmc_init(struct bd_info *bis) { return -ENOSYS; }
+static inline void fdt_fixup_esdhc(void *blob, struct bd_info *bd) {}
#endif /* CONFIG_FSL_ESDHC */
void __noreturn mmc_boot(void);
void mmc_spl_load_image(uint32_t offs, unsigned int size, void *vdst);
diff --git a/include/fsl_esdhc_imx.h b/include/fsl_esdhc_imx.h
index 279a66d..45ed635 100644
--- a/include/fsl_esdhc_imx.h
+++ b/include/fsl_esdhc_imx.h
@@ -259,12 +259,12 @@
#endif
#ifdef CONFIG_FSL_ESDHC_IMX
-int fsl_esdhc_mmc_init(bd_t *bis);
-int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg);
-void fdt_fixup_esdhc(void *blob, bd_t *bd);
+int fsl_esdhc_mmc_init(struct bd_info *bis);
+int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg);
+void fdt_fixup_esdhc(void *blob, struct bd_info *bd);
#else
-static inline int fsl_esdhc_mmc_init(bd_t *bis) { return -ENOSYS; }
-static inline void fdt_fixup_esdhc(void *blob, bd_t *bd) {}
+static inline int fsl_esdhc_mmc_init(struct bd_info *bis) { return -ENOSYS; }
+static inline void fdt_fixup_esdhc(void *blob, struct bd_info *bd) {}
#endif /* CONFIG_FSL_ESDHC_IMX */
void __noreturn mmc_boot(void);
void mmc_spl_load_image(uint32_t offs, unsigned int size, void *vdst);
diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h
index 8857d50..41cb737 100644
--- a/include/fsl_mdio.h
+++ b/include/fsl_mdio.h
@@ -59,6 +59,6 @@
struct tsec_mii_mng __iomem *regs;
char *name;
};
-int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info);
+int fsl_pq_mdio_init(struct bd_info *bis, struct fsl_pq_mdio_info *info);
#endif /* __FSL_PHY_H__ */
diff --git a/include/image.h b/include/image.h
index 9ababf2..9a5a87d 100644
--- a/include/image.h
+++ b/include/image.h
@@ -412,7 +412,7 @@
ulong initrd_end;
ulong cmdline_start;
ulong cmdline_end;
- bd_t *kbd;
+ struct bd_info *kbd;
#endif
int verify; /* env_get("verify")[0] != 'n' */
@@ -755,7 +755,7 @@
ulong *initrd_start, ulong *initrd_end);
int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end);
#ifdef CONFIG_SYS_BOOT_GET_KBD
-int boot_get_kbd(struct lmb *lmb, bd_t **kbd);
+int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd);
#endif /* CONFIG_SYS_BOOT_GET_KBD */
#endif /* !USE_HOSTCC */
diff --git a/include/lmb.h b/include/lmb.h
index 3b338df..73b7a5c 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -31,7 +31,8 @@
};
extern void lmb_init(struct lmb *lmb);
-extern void lmb_init_and_reserve(struct lmb *lmb, bd_t *bd, void *fdt_blob);
+extern void lmb_init_and_reserve(struct lmb *lmb, struct bd_info *bd,
+ void *fdt_blob);
extern void lmb_init_and_reserve_range(struct lmb *lmb, phys_addr_t base,
phys_size_t size, void *fdt_blob);
extern long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size);
diff --git a/include/mvebu_mmc.h b/include/mvebu_mmc.h
index 7397165..a35e5a1 100644
--- a/include/mvebu_mmc.h
+++ b/include/mvebu_mmc.h
@@ -269,6 +269,6 @@
* Functions prototypes
*/
-int mvebu_mmc_init(bd_t *bis);
+int mvebu_mmc_init(struct bd_info *bis);
#endif /* __MVEBU_MMC_H__ */
diff --git a/include/net/pfe_eth/pfe_eth.h b/include/net/pfe_eth/pfe_eth.h
index 116a2b2..92dc46e 100644
--- a/include/net/pfe_eth/pfe_eth.h
+++ b/include/net/pfe_eth/pfe_eth.h
@@ -97,7 +97,7 @@
struct mii_dev *pfe_mdio_init(struct pfe_mdio_info *mdio_info);
void pfe_set_mdio(int dev_id, struct mii_dev *bus);
void pfe_set_phy_address_mode(int dev_id, int phy_id, int phy_mode);
-int gemac_initialize(bd_t *bis, int dev_id, char *devname);
+int gemac_initialize(struct bd_info *bis, int dev_id, char *devname);
int pfe_init(struct pfe_ddr_address *pfe_addr);
int pfe_eth_board_init(struct udevice *dev);
diff --git a/include/netdev.h b/include/netdev.h
index f2d21c4..b1eb5fc 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -21,63 +21,65 @@
* -1: failure
*/
-int board_eth_init(bd_t *bis);
+int board_eth_init(struct bd_info *bis);
int board_interface_eth_init(struct udevice *dev,
phy_interface_t interface_type);
-int cpu_eth_init(bd_t *bis);
+int cpu_eth_init(struct bd_info *bis);
/* Driver initialization prototypes */
-int at91emac_register(bd_t *bis, unsigned long iobase);
-int ax88180_initialize(bd_t *bis);
-int bcm_sf2_eth_register(bd_t *bis, u8 dev_num);
-int bfin_EMAC_initialize(bd_t *bis);
+int at91emac_register(struct bd_info *bis, unsigned long iobase);
+int ax88180_initialize(struct bd_info *bis);
+int bcm_sf2_eth_register(struct bd_info *bis, u8 dev_num);
+int bfin_EMAC_initialize(struct bd_info *bis);
int calxedaxgmac_initialize(u32 id, ulong base_addr);
int cs8900_initialize(u8 dev_num, int base_addr);
-int dc21x4x_initialize(bd_t *bis);
+int dc21x4x_initialize(struct bd_info *bis);
int designware_initialize(ulong base_addr, u32 interface);
-int dm9000_initialize(bd_t *bis);
+int dm9000_initialize(struct bd_info *bis);
int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr);
-int e1000_initialize(bd_t *bis);
-int eepro100_initialize(bd_t *bis);
+int e1000_initialize(struct bd_info *bis);
+int eepro100_initialize(struct bd_info *bis);
int ep93xx_eth_initialize(u8 dev_num, int base_addr);
-int eth_3com_initialize (bd_t * bis);
+int eth_3com_initialize (struct bd_info * bis);
int ethoc_initialize(u8 dev_num, int base_addr);
-int fec_initialize (bd_t *bis);
-int fecmxc_initialize(bd_t *bis);
-int fecmxc_initialize_multi(bd_t *bis, int dev_id, int phy_id, uint32_t addr);
-int ftmac100_initialize(bd_t *bits);
-int ftmac110_initialize(bd_t *bits);
-void gt6426x_eth_initialize(bd_t *bis);
+int fec_initialize (struct bd_info *bis);
+int fecmxc_initialize(struct bd_info *bis);
+int fecmxc_initialize_multi(struct bd_info *bis, int dev_id, int phy_id,
+ uint32_t addr);
+int ftmac100_initialize(struct bd_info *bits);
+int ftmac110_initialize(struct bd_info *bits);
+void gt6426x_eth_initialize(struct bd_info *bis);
int ks8851_mll_initialize(u8 dev_num, int base_addr);
int lan91c96_initialize(u8 dev_num, int base_addr);
-int lpc32xx_eth_initialize(bd_t *bis);
+int lpc32xx_eth_initialize(struct bd_info *bis);
int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-int mcdmafec_initialize(bd_t *bis);
-int mcffec_initialize(bd_t *bis);
-int mvgbe_initialize(bd_t *bis);
-int mvneta_initialize(bd_t *bis, int base_addr, int devnum, int phy_addr);
-int natsemi_initialize(bd_t *bis);
+int mcdmafec_initialize(struct bd_info *bis);
+int mcffec_initialize(struct bd_info *bis);
+int mvgbe_initialize(struct bd_info *bis);
+int mvneta_initialize(struct bd_info *bis, int base_addr, int devnum,
+ int phy_addr);
+int natsemi_initialize(struct bd_info *bis);
int ne2k_register(void);
-int npe_initialize(bd_t *bis);
-int ns8382x_initialize(bd_t *bis);
-int pcnet_initialize(bd_t *bis);
-int ppc_4xx_eth_initialize (bd_t *bis);
-int rtl8139_initialize(bd_t *bis);
-int rtl8169_initialize(bd_t *bis);
-int scc_initialize(bd_t *bis);
-int sh_eth_initialize(bd_t *bis);
-int skge_initialize(bd_t *bis);
+int npe_initialize(struct bd_info *bis);
+int ns8382x_initialize(struct bd_info *bis);
+int pcnet_initialize(struct bd_info *bis);
+int ppc_4xx_eth_initialize (struct bd_info *bis);
+int rtl8139_initialize(struct bd_info *bis);
+int rtl8169_initialize(struct bd_info *bis);
+int scc_initialize(struct bd_info *bis);
+int sh_eth_initialize(struct bd_info *bis);
+int skge_initialize(struct bd_info *bis);
int smc91111_initialize(u8 dev_num, int base_addr);
int smc911x_initialize(u8 dev_num, int base_addr);
-int uec_standard_init(bd_t *bis);
-int uli526x_initialize(bd_t *bis);
+int uec_standard_init(struct bd_info *bis);
+int uli526x_initialize(struct bd_info *bis);
int armada100_fec_register(unsigned long base_addr);
/* Boards with PCI network controllers can call this from their board_eth_init()
* function to initialize whatever's on board.
* Return value is total # of devices found */
-static inline int pci_eth_init(bd_t *bis)
+static inline int pci_eth_init(struct bd_info *bis)
{
int num = 0;
@@ -119,7 +121,7 @@
#ifdef CONFIG_PHYLIB
struct phy_device;
-int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
+int fec_probe(struct bd_info *bd, int dev_id, uint32_t base_addr,
struct mii_dev *bus, struct phy_device *phydev);
#else
/*
diff --git a/include/tsec.h b/include/tsec.h
index b17fa95..43255e5 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -426,8 +426,9 @@
};
#ifndef CONFIG_DM_ETH
-int tsec_standard_init(bd_t *bis);
-int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsec_info, int num);
+int tsec_standard_init(struct bd_info *bis);
+int tsec_eth_init(struct bd_info *bis, struct tsec_info_struct *tsec_info,
+ int num);
#endif
#endif /* __TSEC_H */
diff --git a/include/vsc9953.h b/include/vsc9953.h
index 5d6fc77..a9c84b4 100644
--- a/include/vsc9953.h
+++ b/include/vsc9953.h
@@ -712,7 +712,7 @@
struct vsc9953_port_info port[VSC9953_MAX_PORTS];
};
-void vsc9953_init(bd_t *bis);
+void vsc9953_init(struct bd_info *bis);
void vsc9953_port_info_set_mdio(int port_no, struct mii_dev *bus);
void vsc9953_port_info_set_phy_address(int port_no, int address);