imx: fix coding style
Subsystems (2)
PATCH v2 1/1 imx: fix coding style
Fix checkpatch warning and errors in several i.MX related files.
While at it also address a checkpatch warning at arch/arm/cpu/armv7/mx5/soc.c regarding the usage of extern in a C file.
---
Changes since v1:
- Fix multi-line style
- Add comment in the changelog regarding the fix for externs in C file
- Remove ifdef from header file
arch/arm/cpu/arm1136/mx31/timer.c | 23 ++++-- arch/arm/cpu/arm1136/mx35/generic.c | 2 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 110 +++++++++++++------------- arch/arm/cpu/arm926ejs/mx25/reset.c | 2 +- arch/arm/cpu/arm926ejs/mx25/timer.c | 16 ++-- arch/arm/cpu/arm926ejs/mx27/reset.c | 2 +- arch/arm/cpu/arm926ejs/mx27/timer.c | 14 ++-- arch/arm/cpu/armv7/mx5/soc.c | 10 +-- arch/arm/include/asm/arch-mx5/sys_proto.h | 8 ++ board/davedenx/qong/qong.c | 10 +- board/freescale/mx31ads/mx31ads.c | 2 +- board/karo/tx25/tx25.c | 2 +- board/logicpd/imx27lite/imx27lite.c | 6 +- board/logicpd/imx31_litekit/imx31_litekit.c | 2 +- 14 files changed, 108 insertions(+), 101 deletions(-)
arch/arm/cpu/arm1136/mx31/timer.c +14 -9
@@ -43,7 +43,11 @@DECLARE_GLOBAL_DATA_PTR ; -/* "time" is measured in 1 / CONFIG_SYS_HZ seconds, "tick" is internal timer period */ +/* +* "time" is measured in 1 / CONFIG_SYS_HZ seconds, +* "tick" is internal timer period +*/ +#ifdef CONFIG_MX31_TIMER_HIGH_PRECISION /* ~0.4% error - measured with stop-watch on 100s boot-delay */ static inline unsigned long long tick_to_time (unsigned long long tick)
@@ -68,7 +72,8 @@ static inline unsigned long long us_to_tick(unsigned long long us) }#else /* ~2% error */ -#define TICK_PER_TIME ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ) +#define TICK_PER_TIME ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) \ + / CONFIG_SYS_HZ)#define US_PER_TICK (1000000 / CONFIG_MX31_CLK32)static inline unsigned long long tick_to_time (unsigned long long tick)
@@ -91,7 +96,7 @@ static inline unsigned long long us_to_tick(unsigned long long us)#endif /* The 32768Hz 32-bit timer overruns in 131072 seconds */ -int timer_init (void ) +int timer_init (void ) {int i;
@@ -106,7 +111,7 @@ int timer_init (void)return 0 ; } -unsigned long long get_ticks (void ) +unsigned long long get_ticks (void ) {ulong now =GPTCNT ;/* current tick value */
@@ -119,7 +124,7 @@ unsigned long long get_ticks (void)return gd->tbl; } -ulong get_timer_masked (void ) +ulong get_timer_masked (void ) {/* * get_ticks() returns a long long (64 bit), it wraps in
@@ -130,13 +135,13 @@ ulong get_timer_masked (void)return tick_to_time (get_ticks ()); } -ulong get_timer (ulong base) +ulong get_timer (ulong base) { -return get_timer_masked () - base; +return get_timer_masked () - base; }/* delay x useconds AND preserve advance timestamp value */ -void __udelay (unsigned long usec) +void __udelay (unsigned long usec) {unsigned long long tmp;ulong tmo;
@@ -148,7 +153,7 @@ void __udelay (unsigned long usec)/*NOP*/ ; } -void reset_cpu (ulong addr) +void reset_cpu (ulong addr) {struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE ; wdog->wcr =WDOG_ENABLE ;
arch/arm/cpu/arm1136/mx35/generic.c +1 -1
@@ -240,7 +240,7 @@ unsigned int mxc_get_main_clock(enum mxc_main_clocks clk) }break ;case IPG_CLK : - ret_val =get_ipg_clk ();; + ret_val =get_ipg_clk ();break ;case IPG_PER_CLK : ret_val =get_ipg_per_clk ();
arch/arm/cpu/arm926ejs/mx25/generic.c +55 -55
237 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx25/reset.c +1 -1
@@ -39,7 +39,7 @@/* * Reset the cpu by setting up the watchdog timer and let it time out */ -void reset_cpu (ulong ignored) +void reset_cpu (ulong ignored) {struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE ;/* Disable watchdog and set Time-Out field to 0 */
arch/arm/cpu/arm926ejs/mx25/timer.c +8 -8
@@ -15,7 +15,7 @@* * (C) Copyright 2009 DENX Software Engineering * Author: John Rigby <[email protected]> -* Add support for MX25 +* Add support for MX25 * * See file CREDITS for list of people who contributed to this * project.
@@ -43,8 +43,8 @@DECLARE_GLOBAL_DATA_PTR ; -#define timestamp gd->tbl -#define lastinc gd->lastinc +#define timestamp (gd->tbl) +#define lastinc (gd->lastinc)/* * "time" is measured in 1 / CONFIG_SYS_HZ seconds,
@@ -121,7 +121,7 @@ int timer_init(void)return 0 ; } -unsigned long long get_ticks (void ) +unsigned long long get_ticks (void ) {struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE ;ulong now =readl (&gpt->counter);/* current tick value */
@@ -140,7 +140,7 @@ unsigned long long get_ticks (void)return timestamp; } -ulong get_timer_masked (void ) +ulong get_timer_masked (void ) {/* * get_ticks() returns a long long (64 bit), it wraps in
@@ -151,13 +151,13 @@ ulong get_timer_masked (void)return tick_to_time (get_ticks ()); } -ulong get_timer (ulong base) +ulong get_timer (ulong base) { -return get_timer_masked () - base; +return get_timer_masked () - base; }/* delay x useconds AND preserve advance timstamp value */ -void __udelay (unsigned long usec) +void __udelay (unsigned long usec) {unsigned long long tmp;ulong tmo;
arch/arm/cpu/arm926ejs/mx27/reset.c +1 -1
@@ -39,7 +39,7 @@/* * Reset the cpu by setting up the watchdog timer and let it time out */ -void reset_cpu (ulong ignored) +void reset_cpu (ulong ignored) {struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE ;/* Disable watchdog and set Time-Out field to 0 */
arch/arm/cpu/arm926ejs/mx27/timer.c +7 -7
@@ -45,8 +45,8 @@DECLARE_GLOBAL_DATA_PTR ; -#define timestamp gd->tbl -#define lastinc gd->lastinc +#define timestamp (gd->tbl) +#define lastinc (gd->lastinc)/* * "time" is measured in 1 / CONFIG_SYS_HZ seconds,
@@ -124,7 +124,7 @@ int timer_init(void)return 0 ; } -unsigned long long get_ticks (void ) +unsigned long long get_ticks (void ) {struct gpt_regs *regs = (struct gpt_regs *)IMX_TIM1_BASE ;ulong now =readl (®s->gpt_tcn);/* current tick value */
@@ -143,7 +143,7 @@ unsigned long long get_ticks (void)return timestamp; } -ulong get_timer_masked (void ) +ulong get_timer_masked (void ) {/* * get_ticks() returns a long long (64 bit), it wraps in
@@ -154,13 +154,13 @@ ulong get_timer_masked (void)return tick_to_time (get_ticks ()); } -ulong get_timer (ulong base) +ulong get_timer (ulong base) { -return get_timer_masked () - base; +return get_timer_masked () - base; }/* delay x useconds AND preserve advance timstamp value */ -void __udelay (unsigned long usec) +void __udelay (unsigned long usec) {unsigned long long tmp;ulong tmo;
arch/arm/cpu/armv7/mx5/soc.c +2 -8
@@ -26,6 +26,8 @@#include <common.h> #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> +#include <asm/arch/sys_proto.h> +#include <asm/errno.h> #include <asm/io.h>
@@ -117,14 +119,6 @@ int print_cpuinfo(void) }#endif -/* -* Initializes on-chip ethernet controllers. -* to override, implement board_eth_init() -*/ -#if defined(CONFIG_FEC_MXC ) -extern int fecmxc_initialize (bd_t *bis); -#endif -int cpu_eth_init (bd_t *bis) {int rc = -ENODEV ;
arch/arm/include/asm/arch-mx5/sys_proto.h +8 -0
@@ -28,4 +28,12 @@ u32 get_cpu_rev(void);#define is_soc_rev (rev) ((get_cpu_rev() & 0xFF) - rev)void sdelay (unsigned long );void set_chipselect_size (int const ); + +/* +* Initializes on-chip ethernet controllers. +* to override, implement board_eth_init() +*/ + +int fecmxc_initialize (bd_t *bis); +#endif
board/davedenx/qong/qong.c +5 -5
@@ -41,7 +41,7 @@ void hw_watchdog_reset(void) }#endif -int dram_init (void ) +int dram_init (void ) {/* dram_init must store complete ramsize in gd->ram_size */ gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
@@ -58,7 +58,7 @@ static void qong_fpga_reset(void)udelay (300 ); } -int board_early_init_f (void ) +int board_early_init_f (void ) {#ifdef CONFIG_QONG_FPGA /* CS1: FPGA/Network Controller/GPIO */
@@ -141,7 +141,7 @@ int board_early_init_f (void) } -int board_init (void ) +int board_init (void ) {/* Chip selects */ /* CS0: Nor Flash #0 - it must be init'ed when executing from DDR */
@@ -216,13 +216,13 @@ int board_late_init(void)return 0 ; } -int checkboard (void ) +int checkboard (void ) {printf ("Board: DAVE/DENX Qong\n" );return 0 ; } -int misc_init_r (void ) +int misc_init_r (void ) {#ifdef CONFIG_QONG_FPGA u32 tmp;
board/freescale/mx31ads/mx31ads.c +1 -1
@@ -104,7 +104,7 @@ int board_init(void)return 0 ; } -int checkboard (void ) +int checkboard (void ) {printf ("Board: MX31ADS\n" );return 0 ;
board/karo/tx25/tx25.c +1 -1
@@ -157,7 +157,7 @@ int board_late_init(void)return 0 ; } -int dram_init (void ) +int dram_init (void ) {/* dram_init must store complete ramsize in gd->ram_size */ gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1,
board/logicpd/imx27lite/imx27lite.c +3 -3
@@ -26,7 +26,7 @@DECLARE_GLOBAL_DATA_PTR ; -int board_init (void ) +int board_init (void ) {struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE ;#if defined(CONFIG_SYS_NAND_LARGEPAGE )
@@ -64,7 +64,7 @@ int board_init (void)return 0 ; } -int dram_init (void ) +int dram_init (void ) {/* dram_init must store complete ramsize in gd->ram_size */ gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
@@ -86,7 +86,7 @@ void dram_init_banksize(void)int checkboard (void ) { -puts ("Board: " ); +puts ("Board: " );puts (CONFIG_BOARDNAME );return 0 ; }
board/logicpd/imx31_litekit/imx31_litekit.c +1 -1
@@ -75,7 +75,7 @@ int board_init(void)return 0 ; } -int checkboard (void ) +int checkboard (void ) {printf ("Board: i.MX31 Litekit\n" );return 0 ;
Signature · 1 line
1.7.1
PATCH v2 1/1 imx: fix coding style
Quoted 12 lines · Fabio Estevam
Fix checkpatch warning and errors in several i.MX related files.
While at it also address a checkpatch warning at
arch/arm/cpu/armv7/mx5/soc.cregarding the usage of extern in a C file.Signed-off-by Fabio Estevam <[email protected]>---
Changes since v1:
- Fix multi-line style
- Add comment in the changelog regarding the fix for externs in C file
- Remove ifdef from header file
Quoted 16 lines
arch/arm/cpu/arm1136/mx31/timer.c | 23 ++++-- arch/arm/cpu/arm1136/mx35/generic.c | 2 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 110 +++++++++++++------------- arch/arm/cpu/arm926ejs/mx25/reset.c | 2 +- arch/arm/cpu/arm926ejs/mx25/timer.c | 16 ++-- arch/arm/cpu/arm926ejs/mx27/reset.c | 2 +- arch/arm/cpu/arm926ejs/mx27/timer.c | 14 ++-- arch/arm/cpu/armv7/mx5/soc.c | 10 +-- arch/arm/include/asm/arch-mx5/sys_proto.h | 8 ++ board/davedenx/qong/qong.c | 10 +- board/freescale/mx31ads/mx31ads.c | 2 +- board/karo/tx25/tx25.c | 2 +- board/logicpd/imx27lite/imx27lite.c | 6 +- board/logicpd/imx31_litekit/imx31_litekit.c | 2 +- 14 files changed, 108 insertions(+), 101 deletions(-)
Applied to u-boot-imx, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================