From b75d8dc5642b71eb029e7cd38031a32029e736cc Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 26 Jun 2020 15:13:33 +0900 Subject: 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 #include 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: @@ typedef bd_t; @@ -bd_t +struct bd_info Signed-off-by: Masahiro Yamada --- arch/arm/cpu/arm926ejs/mx25/generic.c | 4 ++-- arch/arm/cpu/arm926ejs/mx27/generic.c | 4 ++-- arch/arm/cpu/arm926ejs/mxs/mxs.c | 2 +- arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/arm/cpu/arm926ejs') diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c index 8f6cd4dc19..a4528cbaf5 100644 --- a/arch/arm/cpu/arm926ejs/mx25/generic.c +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c @@ -223,7 +223,7 @@ int print_cpuinfo(void) * Initializes on-chip ethernet controllers. * to override, implement board_eth_init() */ -int cpu_eth_init(bd_t *bis) +int cpu_eth_init(struct bd_info *bis) { struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; ulong val; @@ -252,7 +252,7 @@ int get_clocks(void) * Initializes on-chip MMC controllers. * to override, implement board_mmc_init() */ -int cpu_mmc_init(bd_t *bis) +int cpu_mmc_init(struct bd_info *bis) { return fsl_esdhc_mmc_init(bis); } diff --git a/arch/arm/cpu/arm926ejs/mx27/generic.c b/arch/arm/cpu/arm926ejs/mx27/generic.c index a003ab816a..8b9d3a272a 100644 --- a/arch/arm/cpu/arm926ejs/mx27/generic.c +++ b/arch/arm/cpu/arm926ejs/mx27/generic.c @@ -177,7 +177,7 @@ int print_cpuinfo (void) } #endif -int cpu_eth_init(bd_t *bis) +int cpu_eth_init(struct bd_info *bis) { #if defined(CONFIG_FEC_MXC) struct pll_regs *pll = (struct pll_regs *)IMX_PLL_BASE; @@ -195,7 +195,7 @@ int cpu_eth_init(bd_t *bis) * Initializes on-chip MMC controllers. * to override, implement board_mmc_init() */ -int cpu_mmc_init(bd_t *bis) +int cpu_mmc_init(struct bd_info *bis) { #ifdef CONFIG_MMC_MXC return mxc_mmc_init(bis); diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs.c b/arch/arm/cpu/arm926ejs/mxs/mxs.c index 12ebc1c802..8243aeb2c0 100644 --- a/arch/arm/cpu/arm926ejs/mxs/mxs.c +++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c @@ -203,7 +203,7 @@ int do_mx28_showclocks(struct cmd_tbl *cmdtp, int flag, int argc, * Initializes on-chip ethernet controllers. */ #if defined(CONFIG_MX28) && defined(CONFIG_CMD_NET) -int cpu_eth_init(bd_t *bis) +int cpu_eth_init(struct bd_info *bis) { struct mxs_clkctrl_regs *clkctrl_regs = (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE; diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index 565392eab5..1501d7df0d 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c @@ -22,7 +22,7 @@ DECLARE_GLOBAL_DATA_PTR; static gd_t gdata __section(".data"); #ifdef CONFIG_SPL_SERIAL_SUPPORT -static bd_t bdata __section(".data"); +static struct bd_info bdata __section(".data"); #endif /* -- cgit v1.2.3