arm: cleanup prototypes in u-boot-arm.h
Subsystems (7)
cover arm: cleanup prototypes in u-boot-arm.h
When I check the patch
http://patchwork.ozlabs.org/patch/978762/
I see that some prototypes in u-boot-arm.h are not needed as they are unused or only used locally.
This patset removes them in u-boot-arm.h;
3 patch are simple but in 2 patches I need to udpate timer.c files in many architecture but without functional
change: functions modified to static, sometime I need to reorder the function.
Compilation tested on v2018.11-rc1 for arm boards with buildman:
tools/buildman/buildman arm aarch64
540 270 4 /814
=> no new warning introduced (only device tree issue)
Patrick Delaunay (5):
arm: remove prototype for arch_interrupt_init
arm: remove prototype for reset_timer_masked
arm: remove prototype for udelay_masked
arm: remove prototype for get_timer_masked
arm: remove duplicated prototypes in u-boot.arm.h
arch/arm/cpu/arm920t/ep93xx/timer.c | 7 +---- arch/arm/cpu/arm920t/imx/timer.c | 15 ++++------- arch/arm/cpu/arm926ejs/armada100/timer.c | 2 +- arch/arm/cpu/arm926ejs/mx27/timer.c | 2 +- arch/arm/cpu/arm926ejs/mxs/timer.c | 7 +---- arch/arm/cpu/arm926ejs/spear/timer.c | 9 +++---- arch/arm/cpu/armv7/ls102xa/timer.c | 7 +---- arch/arm/cpu/armv7/s5p-common/timer.c | 3 ++- arch/arm/cpu/armv7/stv0991/timer.c | 9 +++---- arch/arm/cpu/armv7/sunxi/timer.c | 12 ++++----- arch/arm/cpu/armv7/vf610/timer.c | 7 +---- arch/arm/cpu/sa1100/timer.c | 15 ++++------- arch/arm/include/asm/u-boot-arm.h | 9 ------- arch/arm/mach-at91/arm920t/timer.c | 19 +++++--------- arch/arm/mach-imx/syscounter.c | 7 +---- arch/arm/mach-omap2/timer.c | 3 ++- arch/arm/mach-orion5x/timer.c | 2 +- board/armltd/integrator/timer.c | 45 ++++++++++++++------------------ 18 files changed, 61 insertions(+), 119 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/5 arm: remove prototype for arch_interrupt_init
Remove prototype for no more existing function
---
arch/arm/include/asm/u-boot-arm.h | 1 - 1 file changed, 1 deletion(-)
arch/arm/include/asm/u-boot-arm.h +0 -1
@@ -39,7 +39,6 @@ int arch_early_init_r(void);int board_init (void );/* cpu/.../interrupt.c */ -int arch_interrupt_init (void );void reset_timer_masked (void );ulong get_timer_masked (void );void udelay_masked (unsigned long usec);
Signature · 1 line
2.7.4
PATCH 2/5 arm: remove prototype for reset_timer_masked
In reply to Patrick DelaunayRemove prototype for function only used in one file
---
arch/arm/cpu/armv7/s5p-common/timer.c | 3 ++- arch/arm/include/asm/u-boot-arm.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/s5p-common/timer.c +2 -1
@@ -19,6 +19,7 @@DECLARE_GLOBAL_DATA_PTR ;unsigned long get_current_tick (void ); +static void reset_timer_masked (void );/* macro to read the 16 bit timer */ static inline struct s5p_timer *s5p_get_base_timer (void )
@@ -106,7 +107,7 @@ void __udelay(unsigned long usec) ; } -void reset_timer_masked (void ) +static void reset_timer_masked (void ) {struct s5p_timer *const timer =s5p_get_base_timer ();
arch/arm/include/asm/u-boot-arm.h +0 -1
@@ -39,7 +39,6 @@ int arch_early_init_r(void);int board_init (void );/* cpu/.../interrupt.c */ -void reset_timer_masked (void );ulong get_timer_masked (void );void udelay_masked (unsigned long usec);
Signature · 1 line
2.7.4
PATCH 3/5 arm: remove prototype for udelay_masked
In reply to Patrick DelaunayThe interruption support had be removed for ARM architecture and the function udelay_masked() is no more used except in some timer.c files and have the same content than udelay() or __udelay().
This patch update each timer.c implementing this function and remove the associated prototype in u-boot-arm.h.
---
arch/arm/cpu/arm920t/imx/timer.c | 7 +------ arch/arm/cpu/arm926ejs/spear/timer.c | 5 ----- arch/arm/cpu/armv7/stv0991/timer.c | 5 ----- arch/arm/cpu/sa1100/timer.c | 7 +------ arch/arm/include/asm/u-boot-arm.h | 1 - arch/arm/mach-at91/arm920t/timer.c | 7 +------ board/armltd/integrator/timer.c | 6 ------ 7 files changed, 3 insertions(+), 35 deletions(-)
arch/arm/cpu/arm920t/imx/timer.c +1 -6
@@ -46,7 +46,7 @@ ulong get_timer_masked (void)return TCN1 ; } -void udelay_masked (unsigned long usec) +void __udelay (unsigned long usec) {ulong endtime =get_timer_masked () + usec;signed long diff;
@@ -57,11 +57,6 @@ void udelay_masked (unsigned long usec) }while (diff >=0 ); } -void __udelay (unsigned long usec) -{ -udelay_masked (usec); -} -/* * This function is derived from PowerPC code (read timebase as long long). * On ARM it just returns the timer value.
arch/arm/cpu/arm926ejs/spear/timer.c +0 -5
@@ -98,11 +98,6 @@ ulong get_timer_masked(void)return timestamp; } -void udelay_masked (unsigned long usec) -{ -return udelay (usec); -} -/* * This function is derived from PowerPC code (read timebase as long long). * On ARM it just returns the timer value.
arch/arm/cpu/armv7/stv0991/timer.c +0 -5
@@ -89,11 +89,6 @@ ulong get_timer_masked(void)return timestamp; } -void udelay_masked (unsigned long usec) -{ -return udelay (usec); -} -/* * This function is derived from PowerPC code (read timebase as long long). * On ARM it just returns the timer value.
arch/arm/cpu/sa1100/timer.c +1 -6
@@ -17,17 +17,12 @@ ulong get_timer (ulong base)return get_timer_masked (); } -void __udelay (unsigned long usec) -{ -udelay_masked (usec); -} -ulong get_timer_masked (void ) {return OSCR ; } -void udelay_masked (unsigned long usec) +void __udelay (unsigned long usec) {ulong tmo;ulong endtime;
arch/arm/include/asm/u-boot-arm.h +0 -1
@@ -40,7 +40,6 @@ int board_init(void);/* cpu/.../interrupt.c */ ulong get_timer_masked (void ); -void udelay_masked (unsigned long usec);/* calls to c from vectors.S */ struct pt_regs ;
arch/arm/mach-at91/arm920t/timer.c +1 -6
@@ -58,11 +58,6 @@ ulong get_timer(ulong base)return get_timer_masked () - base; } -void __udelay (unsigned long usec) -{ -udelay_masked (usec); -} -ulong get_timer_raw (void ) {at91_tc_t *tc = (at91_tc_t *)ATMEL_BASE_TC ;
@@ -87,7 +82,7 @@ ulong get_timer_masked(void)return get_timer_raw ()/TIMER_LOAD_VAL ; } -void udelay_masked (unsigned long usec) +void __udelay (unsigned long usec) {u32 tmo;u32 endtime;
board/armltd/integrator/timer.c +0 -6
@@ -138,12 +138,6 @@ ulong get_timer_masked (void)return timestamp; } -/* waits specified delay value and resets timestamp */ -void udelay_masked (unsigned long usec) -{ -udelay (usec); -} -/* * This function is derived from PowerPC code (read timebase as long long). * On ARM it just returns the timer value.
Signature · 1 line
2.7.4
PATCH 4/5 arm: remove prototype for get_timer_masked
In reply to Patrick DelaunayThe interruption support had be removed for ARM architecture and the function get_timer_masked() is no more used except in some the timer.c files.
This patch clean each timer.c which implement this function and remove the associated prototype in u-boot-arm.h
For timer.c, I don't verify if the weak version of get_timer (in lib/time.c) can be used
---
arch/arm/cpu/arm920t/ep93xx/timer.c | 7 +---- arch/arm/cpu/arm920t/imx/timer.c | 8 +++--- arch/arm/cpu/arm926ejs/armada100/timer.c | 2 +- arch/arm/cpu/arm926ejs/mx27/timer.c | 2 +- arch/arm/cpu/arm926ejs/mxs/timer.c | 7 +---- arch/arm/cpu/arm926ejs/spear/timer.c | 4 ++- arch/arm/cpu/armv7/ls102xa/timer.c | 7 +---- arch/arm/cpu/armv7/stv0991/timer.c | 4 ++- arch/arm/cpu/armv7/sunxi/timer.c | 12 ++++----- arch/arm/cpu/armv7/vf610/timer.c | 7 +---- arch/arm/cpu/sa1100/timer.c | 8 +++--- arch/arm/include/asm/u-boot-arm.h | 3 --- arch/arm/mach-at91/arm920t/timer.c | 12 ++++----- arch/arm/mach-imx/syscounter.c | 7 +---- arch/arm/mach-omap2/timer.c | 3 ++- arch/arm/mach-orion5x/timer.c | 2 +- board/armltd/integrator/timer.c | 45 ++++++++++++++++---------------- 17 files changed, 59 insertions(+), 81 deletions(-)
arch/arm/cpu/arm920t/ep93xx/timer.c +1 -6
@@ -66,14 +66,9 @@ unsigned long long get_ticks(void)return sys_ticks; } -unsigned long get_timer_masked (void ) -{ -return get_ticks (); -} -unsigned long get_timer (unsigned long base) { -return get_timer_masked () - base; +return get_ticks () - base; }void __udelay (unsigned long usec)
arch/arm/cpu/arm920t/imx/timer.c +4 -4
@@ -36,14 +36,14 @@ int timer_init (void)/* * timer without interrupts */ -ulong get_timer (ulong base) +static ulong get_timer_masked (void ) { -return get_timer_masked () - base; +return TCN1 ; } -ulong get_timer_masked (void ) +ulong get_timer (ulong base) { -return TCN1 ; +return get_timer_masked () - base; }void __udelay (unsigned long usec)
arch/arm/cpu/arm926ejs/armada100/timer.c +1 -1
@@ -61,7 +61,7 @@ ulong read_timer(void)return (readl (&armd1timers->cvwr)); } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {ulong now =read_timer ();
arch/arm/cpu/arm926ejs/mx27/timer.c +1 -1
@@ -126,7 +126,7 @@ unsigned long long get_ticks(void)return timestamp; } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {/* * get_ticks() returns a long long (64 bit), it wraps in
arch/arm/cpu/arm926ejs/mxs/timer.c +1 -6
@@ -110,14 +110,9 @@ unsigned long long get_ticks(void)return timestamp; } -ulong get_timer_masked (void ) -{ -return tick_to_time (get_ticks ()); -} -ulong get_timer (ulong base) { -return get_timer_masked () - base; +return tick_to_time (get_ticks ()) - base; }/* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */
arch/arm/cpu/arm926ejs/spear/timer.c +3 -1
@@ -21,6 +21,8 @@ static struct misc_regs *const misc_regs_p =DECLARE_GLOBAL_DATA_PTR ; +static ulong get_timer_masked (void ); +#define timestamp gd->arch.tbl#define lastdec gd->arch.lastinc
@@ -82,7 +84,7 @@ void __udelay(unsigned long usec) ; } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {ulong now =READ_TIMER ();
arch/arm/cpu/armv7/ls102xa/timer.c +1 -6
@@ -90,14 +90,9 @@ unsigned long long get_ticks(void)return now; } -unsigned long get_timer_masked (void ) -{ -return tick_to_time (get_ticks ()); -} -unsigned long get_timer (ulong base) { -return get_timer_masked () - base; +return tick_to_time (get_ticks ()) - base; }/* delay x useconds and preserve advance timstamp value */
arch/arm/cpu/armv7/stv0991/timer.c +3 -1
@@ -21,6 +21,8 @@ DECLARE_GLOBAL_DATA_PTR;#define timestamp gd->arch.tbl#define lastdec gd->arch.lastinc +static ulong get_timer_masked (void ); +int timer_init (void ) {/* Timer1 clock configuration */
@@ -73,7 +75,7 @@ void __udelay(unsigned long usec) ; } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {ulong now =READ_TIMER ();
arch/arm/cpu/armv7/sunxi/timer.c +6 -6
@@ -55,12 +55,7 @@ int timer_init(void) }/* timer without interrupts */ -ulong get_timer (ulong base) -{ -return get_timer_masked () - base; -} - -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {/* current tick value */ ulong now =TICKS_TO_HZ (read_timer ());
@@ -77,6 +72,11 @@ ulong get_timer_masked(void)return gd->arch.tbl; } +ulong get_timer (ulong base) +{ +return get_timer_masked () - base; +} +/* delay x useconds */ void __udelay (unsigned long usec) {
arch/arm/cpu/armv7/vf610/timer.c +1 -6
@@ -57,14 +57,9 @@ unsigned long long get_ticks(void)return (((unsigned long long )gd->arch.tbu) <<32 ) | gd->arch.tbl; } -ulong get_timer_masked (void ) -{ -return tick_to_time (get_ticks ()); -} -ulong get_timer (ulong base) { -return get_timer_masked () - base; +return tick_to_time (get_ticks ()) - base; }/* delay x useconds AND preserve advance timstamp value */
arch/arm/cpu/sa1100/timer.c +4 -4
@@ -12,14 +12,14 @@#include <common.h> #include <SA-1100.h> -ulong get_timer (ulong base) +static ulong get_timer_masked (void ) { -return get_timer_masked (); +return OSCR ; } -ulong get_timer_masked (void ) +ulong get_timer (ulong base) { -return OSCR ; +return get_timer_masked (); }void __udelay (unsigned long usec)
arch/arm/include/asm/u-boot-arm.h +0 -3
@@ -38,9 +38,6 @@ int arch_early_init_r(void);/* board/.../... */ int board_init (void ); -/* cpu/.../interrupt.c */ -ulong get_timer_masked (void ); -/* calls to c from vectors.S */ struct pt_regs ;
arch/arm/mach-at91/arm920t/timer.c +6 -6
@@ -53,11 +53,6 @@ int timer_init(void)/* * timer without interrupts */ -ulong get_timer (ulong base) -{ -return get_timer_masked () - base; -} -ulong get_timer_raw (void ) {at91_tc_t *tc = (at91_tc_t *)ATMEL_BASE_TC ;
@@ -77,11 +72,16 @@ ulong get_timer_raw(void)return gd->arch.tbl; } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {return get_timer_raw ()/TIMER_LOAD_VAL ; } +ulong get_timer (ulong base) +{ +return get_timer_masked () - base; +} +void __udelay (unsigned long usec) {u32 tmo;
arch/arm/mach-imx/syscounter.c +1 -6
@@ -89,14 +89,9 @@ unsigned long long get_ticks(void)return now; } -ulong get_timer_masked (void ) -{ -return tick_to_time (get_ticks ()); -} -ulong get_timer (ulong base) { -return get_timer_masked () - base; +return tick_to_time (get_ticks ()) - base; }void __udelay (unsigned long usec)
arch/arm/mach-omap2/timer.c +2 -1
@@ -23,6 +23,7 @@DECLARE_GLOBAL_DATA_PTR ;static struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE ; +static ulong get_timer_masked (void );/* * Nothing really to do with interrupts, just starts up a counter.
@@ -67,7 +68,7 @@ void __udelay(unsigned long usec) } } -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {/* current tick value */ ulong now =readl (&timer_base->tcrr) / (TIMER_CLOCK /CONFIG_SYS_HZ );
arch/arm/mach-orion5x/timer.c +1 -1
@@ -78,7 +78,7 @@ DECLARE_GLOBAL_DATA_PTR;#define timestamp gd->arch.tbl#define lastdec gd->arch.lastinc -ulong get_timer_masked (void ) +static ulong get_timer_masked (void ) {ulong now =read_timer ();
board/armltd/integrator/timer.c +23 -22
60 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 5/5 arm: remove duplicated prototypes in u-boot.arm.h
In reply to Patrick DelaunayRemove the function prototypes duplicated between u-boot.arm.h and init.h/common.h
---
arch/arm/include/asm/u-boot-arm.h | 3 --- 1 file changed, 3 deletions(-)
arch/arm/include/asm/u-boot-arm.h +0 -3
@@ -24,16 +24,13 @@ extern ulong _datarelro_start_ofs;extern ulong IRQ_STACK_START_IN ;/* 8 bytes in IRQ stack */ /* cpu/.../cpu.c */ -int cpu_init (void );int cleanup_before_linux (void );/* Set up ARMv7 MMU, caches and TLBs */ void cpu_init_cp15 (void );/* cpu/.../arch/cpu.c */ -int arch_cpu_init (void );int arch_misc_init (void ); -int arch_early_init_r (void );/* board/.../... */ int board_init (void );
Signature · 1 line
2.7.4
PATCH 4/5 arm: remove prototype for get_timer_masked
In reply to Patrick DelaunayQuoted 11 lines · Patrick Delaunay
The interruption support had be removed for ARM architecture and the function
get_timer_masked()is no more used except in some thetimer.cfiles.This patch clean each
timer.cwhich implement this function and remove the associated prototype inu-boot-arm.hFor
timer.c, I don't verify if the weak version ofget_timer(inlib/time.c) can be usedSigned-off-by Patrick Delaunay <[email protected]>
Looks good to me.
Yours,
Linus Walleij
PATCH 1/5 arm: remove prototype for arch_interrupt_init
In reply to Patrick DelaunayQuoted 3 lines · Patrick Delaunay
Remove prototype for no more existing function
Signed-off-by Patrick Delaunay <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/3f45dd3c/attachment.sig>
PATCH 2/5 arm: remove prototype for reset_timer_masked
In reply to Patrick DelaunayQuoted 3 lines · Patrick Delaunay
Remove prototype for function only used in one file
Signed-off-by Patrick Delaunay <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/13bf19ab/attachment.sig>
PATCH 3/5 arm: remove prototype for udelay_masked
In reply to Patrick DelaunayQuoted 8 lines · Patrick Delaunay
The interruption support had be removed for ARM architecture and the function
udelay_masked()is no more used except in sometimer.cfiles and have the same content thanudelay()or__udelay().This patch update each
timer.cimplementing this function and remove the associated prototype inu-boot-arm.h.Signed-off-by Patrick Delaunay <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/99111a3f/attachment.sig>
PATCH 4/5 arm: remove prototype for get_timer_masked
In reply to Patrick DelaunayQuoted 11 lines · Patrick Delaunay
The interruption support had be removed for ARM architecture and the function
get_timer_masked()is no more used except in some thetimer.cfiles.This patch clean each
timer.cwhich implement this function and remove the associated prototype inu-boot-arm.hFor
timer.c, I don't verify if the weak version ofget_timer(inlib/time.c) can be usedSigned-off-by Patrick Delaunay <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/8efd61c0/attachment.sig>
PATCH 5/5 arm: remove duplicated prototypes in u-boot.arm.h
In reply to Patrick DelaunayQuoted 4 lines · Patrick Delaunay
Remove the function prototypes duplicated between
u-boot.arm.handinit.h/common.hSigned-off-by Patrick Delaunay <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/09a5b3f9/attachment.sig>