MIPS: SiByte: Fix missing function prototypes
PATCH v2 1/1 MIPS: SiByte: Fix missing function prototypes
The SB1250 SWARM build reports missing prototypes for platform time initialization, SoC setup, IRQ and SMP helpers, and both RTC backends.
---
Changes in v2:
- corrected warning reported by kbuild test robot by gating the inclusion of sb1250.h to avoid warnings on bcm63xx_defconfig
arch/mips/include/asm/sibyte/sb1250.h | 17 +++++++++++++++++ arch/mips/mm/cerr-sb1.c | 2 -- arch/mips/mm/tlbex.c | 11 +++++++---- arch/mips/sibyte/bcm1480/irq.c | 4 +--- arch/mips/sibyte/bcm1480/smp.c | 6 +----- arch/mips/sibyte/bcm1480/time.c | 4 ++-- arch/mips/sibyte/common/bus_watcher.c | 2 +- arch/mips/sibyte/sb1250/irq.c | 4 +--- arch/mips/sibyte/sb1250/smp.c | 6 +----- arch/mips/sibyte/sb1250/time.c | 4 ++-- arch/mips/sibyte/swarm/rtc.h | 15 +++++++++++++++ arch/mips/sibyte/swarm/rtc_m41t81.c | 1 + arch/mips/sibyte/swarm/rtc_xicor1241.c | 1 + arch/mips/sibyte/swarm/setup.c | 18 ++---------------- 14 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 arch/mips/sibyte/swarm/rtc.h
arch/mips/include/asm/sibyte/sb1250.h +17 -0
@@ -32,9 +32,26 @@ extern unsigned int soc_type;extern unsigned int periph_rev;extern unsigned int zbbus_mhz; +void sb1_cache_error (void ); + +#ifdef CONFIG_SIBYTE_BUS_WATCHER +void check_bus_watcher (void ); +#endif + +int sb1250_m3_workaround_needed (void ); +void sb1250_setup (void ); +void sb1250_clockevent_init (void ); +void sb1250_clocksource_init (void ); +void sb1250_mailbox_interrupt (void ); +extern void sb1250_mask_irq (int cpu,int irq);extern void sb1250_unmask_irq (int cpu,int irq); +void bcm1480_setup (void ); +void sb1480_clockevent_init (void ); +void sb1480_clocksource_init (void ); +void bcm1480_mailbox_interrupt (void ); +extern void bcm1480_time_init (void );extern void bcm1480_mask_irq (int cpu,int irq);extern void bcm1480_unmask_irq (int cpu,int irq);
arch/mips/mm/cerr-sb1.c +0 -2
@@ -158,8 +158,6 @@ static void check_bus_watcher(void) printk("Bus watcher indicates no error\n"); } } -#else -extern void check_bus_watcher (void );#endif asmlinkage void sb1_cache_error(void)
arch/mips/mm/tlbex.c +7 -4
@@ -37,6 +37,9 @@#include <asm/regdef.h> #include <asm/uasm.h> #include <asm/setup.h> +#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +#include <asm/sibyte/sb1250.h> +#endif #include <asm/tlbex.h> static int mips_xpa_disabled;
@@ -84,13 +87,13 @@ static inline int r4k_250MHZhwbug(void)return 0 ; } -extern int sb1250_m3_workaround_needed (void ); -static inline int __maybe_unused bcm1250_m3_war (void ) { -if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed (); +#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }static inline int __maybe_unused r10000_llsc_war (void )
arch/mips/sibyte/bcm1480/irq.c +1 -3
@@ -198,7 +198,7 @@ static struct irq_chip bcm1480_irq_type = {#endif }; -void __init init_bcm1480_irqs (void ) +static void __init init_bcm1480_irqs (void ) {int i;
@@ -303,8 +303,6 @@ void __init arch_init_irq(void)change_c0_status (ST0_IM , imask); } -extern void bcm1480_mailbox_interrupt (void ); -static inline void dispatch_ip2 (void ) {unsigned long long mask_h, mask_l;
arch/mips/sibyte/bcm1480/smp.c +1 -5
@@ -46,7 +46,7 @@ static void *mailbox_0_regs[] = {/* * SMP init and finish on secondary CPUs */ -void bcm1480_smp_init (void ) +static void bcm1480_smp_init (void ) {unsigned int imask =STATUSF_IP4 |STATUSF_IP3 |STATUSF_IP2 |STATUSF_IP1 |STATUSF_IP0 ;
@@ -83,8 +83,6 @@ static void bcm1480_send_ipi_mask(const struct cpumask *mask,*/ static void bcm1480_init_secondary (void ) { -extern void bcm1480_smp_init (void ); -bcm1480_smp_init (); }
@@ -94,8 +92,6 @@ static void bcm1480_init_secondary(void)*/ static void bcm1480_smp_finish (void ) { -extern void sb1480_clockevent_init (void ); -sb1480_clockevent_init ();local_irq_enable (); }
arch/mips/sibyte/bcm1480/time.c +2 -2
@@ -4,8 +4,8 @@*/ #include <linux/init.h> -extern void sb1480_clockevent_init (void ); -extern void sb1480_clocksource_init (void ); +#include <asm/time.h> +#include <asm/sibyte/sb1250.h> void __init plat_time_init (void ) {
arch/mips/sibyte/common/bus_watcher.c +1 -1
@@ -189,7 +189,7 @@ static irqreturn_t sibyte_bw_int(int irq, void *data)return IRQ_HANDLED ; } -int __init sibyte_bus_watcher (void ) +static int __init sibyte_bus_watcher (void ) {memset (&bw_stats,0 ,sizeof (struct bw_stats_struct )); bw_stats.status_printed =1 ;
arch/mips/sibyte/sb1250/irq.c +1 -3
@@ -179,7 +179,7 @@ static struct irq_chip sb1250_irq_type = {#endif }; -void __init init_sb1250_irqs (void ) +static void __init init_sb1250_irqs (void ) {int i;
@@ -266,8 +266,6 @@ void __init arch_init_irq(void)change_c0_status (ST0_IM , imask); } -extern void sb1250_mailbox_interrupt (void ); -static inline void dispatch_ip2 (void ) {unsigned int cpu =smp_processor_id ();
arch/mips/sibyte/sb1250/smp.c +1 -5
@@ -35,7 +35,7 @@ static void *mailbox_regs[] = {/* * SMP init and finish on secondary CPUs */ -void sb1250_smp_init (void ) +static void sb1250_smp_init (void ) {unsigned int imask =STATUSF_IP4 |STATUSF_IP3 |STATUSF_IP2 |STATUSF_IP1 |STATUSF_IP0 ;
@@ -72,8 +72,6 @@ static inline void sb1250_send_ipi_mask(const struct cpumask *mask,*/ static void sb1250_init_secondary (void ) { -extern void sb1250_smp_init (void ); -sb1250_smp_init (); }
@@ -83,8 +81,6 @@ static void sb1250_init_secondary(void)*/ static void sb1250_smp_finish (void ) { -extern void sb1250_clockevent_init (void ); -sb1250_clockevent_init ();local_irq_enable (); }
arch/mips/sibyte/sb1250/time.c +2 -2
@@ -4,8 +4,8 @@*/ #include <linux/init.h> -extern void sb1250_clocksource_init (void ); -extern void sb1250_clockevent_init (void ); +#include <asm/time.h> +#include <asm/sibyte/sb1250.h> void __init plat_time_init (void ) {
arch/mips/sibyte/swarm/rtc.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _SIBYTE_SWARM_RTC_H +#define _SIBYTE_SWARM_RTC_H + +#include <linux/time64.h> + +int xicor_probe (void ); +int xicor_set_time (time64_t t); +time64_t xicor_get_time (void ); + +int m41t81_probe (void ); +int m41t81_set_time (time64_t t); +time64_t m41t81_get_time (void ); + +#endif /* _SIBYTE_SWARM_RTC_H */
arch/mips/sibyte/swarm/rtc_m41t81.c +1 -0
@@ -17,6 +17,7 @@#include <asm/sibyte/sb1250_regs.h> #include <asm/sibyte/sb1250_smbus.h> +#include "rtc.h" /* M41T81 definitions */
arch/mips/sibyte/swarm/rtc_xicor1241.c +1 -0
@@ -17,6 +17,7 @@#include <asm/sibyte/sb1250_regs.h> #include <asm/sibyte/sb1250_smbus.h> +#include "rtc.h" /* Xicor 1241 definitions */
arch/mips/sibyte/swarm/setup.c +2 -16
@@ -35,28 +35,14 @@#include <asm/sibyte/sb1250_genbus.h> #include <asm/sibyte/board.h> -#ifdef CONFIG_SIBYTE_BCM1x80 -extern void bcm1480_setup (void ); -#elif defined(CONFIG_SIBYTE_SB1250 ) || defined(CONFIG_SIBYTE_BCM112X ) -extern void sb1250_setup (void ); -#else -#error invalid SiByte board configuration -#endif - -extern int xicor_probe (void ); -extern int xicor_set_time (time64_t ); -extern time64_t xicor_get_time (void ); - -extern int m41t81_probe (void ); -extern int m41t81_set_time (time64_t ); -extern time64_t m41t81_get_time (void ); +#include "rtc.h" const char *get_system_type (void ) {return "SiByte " SIBYTE_BOARD_NAME ; } -int swarm_be_handler (struct pt_regs *regs,int is_fixup) +static int swarm_be_handler (struct pt_regs *regs,int is_fixup) {if (!is_fixup && (regs->cp0_cause &4 )) {/* Data bus error - print PA */
Signature · 1 line
2.53.0
Quoted 10 lines · Florian Fainelli
The SB1250 SWARM build reports missing prototypes for platform time initialization, SoC setup, IRQ and SMP helpers, and both RTC backends.
Signed-off-by Florian Fainelli <[email protected]>---
Changes in v2:- corrected warning reported by kbuild test robot by gating the inclusion of
sb1250.hto avoid warnings onbcm63xx_defconfig
Quoted 16 lines
arch/mips/include/asm/sibyte/sb1250.h | 17 +++++++++++++++++ arch/mips/mm/cerr-sb1.c | 2 -- arch/mips/mm/tlbex.c | 11 +++++++---- arch/mips/sibyte/bcm1480/irq.c | 4 +--- arch/mips/sibyte/bcm1480/smp.c | 6 +----- arch/mips/sibyte/bcm1480/time.c | 4 ++-- arch/mips/sibyte/common/bus_watcher.c | 2 +- arch/mips/sibyte/sb1250/irq.c | 4 +--- arch/mips/sibyte/sb1250/smp.c | 6 +----- arch/mips/sibyte/sb1250/time.c | 4 ++-- arch/mips/sibyte/swarm/rtc.h | 15 +++++++++++++++ arch/mips/sibyte/swarm/rtc_m41t81.c | 1 + arch/mips/sibyte/swarm/rtc_xicor1241.c | 1 + arch/mips/sibyte/swarm/setup.c | 18 ++---------------- 14 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 arch/mips/sibyte/swarm/rtc.h
applied to mips-next
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Quoted 2 lines · Florian Fainelli
The SB1250 SWARM build reports missing prototypes for platform time initialization, SoC setup, IRQ and SMP helpers, and both RTC backends.
Thank you for doing this. I've meant to for a long time, but have been
distracted with higher priority stuff.
arch/mips/mm/tlbex.c static inline int r4k_250MHZhwbug(void) · line 97
Quoted 10 lines
static inline int
__maybe_unusedbcm1250_m3_war(void){arch/mips/mm/tlbex.c +4
-2-if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed (); +#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }
It seems a style regression, why is this change needed?
Maciej
Quoted 8 lines · Maciej W. Rozycki
Quoted 2 lines · Florian Fainelli
The SB1250 SWARM build reports missing prototypes for platform time initialization, SoC setup, IRQ and SMP helpers, and both RTC backends.
Thank you for doing this. I've meant to for a long time, but have been
distracted with higher priority stuff.
Quoted 12 lines
arch/mips/mm/tlbex.c static inline int r4k_250MHZhwbug(void) · line 97
Quoted 10 lines
static inline int __maybe_unused bcm1250_m3_war(void) {arch/mips/mm/tlbex.c +4
-2-if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed (); +#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }It seems a style regression, why is this change needed?
The declaration is wrapped under #ifdef CONFIG_SB1_PASS_2_WORKAROUNDS, which would hide the prototype when the option was disabled. The if (IS_ENABLED() would not compile in that case since we would have lacked a visible declaration. We could keep this and just make the prototype unconditionally visible instead.
Thomas, I can send a v3 as an incremental fixup or complete replacement?
Signature · 1 line
Florian
Quoted 13 lines · Florian Fainelli
Quoted 4 lines
Quoted 4 lines
static inline int __maybe_unused bcm1250_m3_war(void) {arch/mips/mm/tlbex.c +0
-2-if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed ();Quoted 8 lines
arch/mips/mm/tlbex.c static inline int r4k_250MHZhwbug(void) · line 97
Quoted 6 lines
arch/mips/mm/tlbex.c +4
-0+#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }It seems a style regression, why is this change needed?
Quoted 5 lines
The declaration is wrapped under #ifdef
CONFIG_SB1_PASS_2_WORKAROUNDS, which would hide the prototype when the option was disabled. The if (IS_ENABLED()would not compile in that case since we would have lacked a visible declaration. We could keep this and just make the prototype unconditionally visible instead.
I've pondered it a bit more and I'm not entirely happy with the use of a
platform header in generic code in the first place. Would <asm/bugs.h> be a better place for the prototype?
Maciej
Quoted 21 lines · Maciej W. Rozycki
Quoted 13 lines · Florian Fainelli
Quoted 4 lines
Quoted 4 lines
static inline int __maybe_unused bcm1250_m3_war(void) {arch/mips/mm/tlbex.c +0
-2-if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed ();Quoted 8 lines
arch/mips/mm/tlbex.c static inline int r4k_250MHZhwbug(void) · line 97
Quoted 6 lines
arch/mips/mm/tlbex.c +4
-0+#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }It seems a style regression, why is this change needed?
Quoted 5 lines
The declaration is wrapped under #ifdef
CONFIG_SB1_PASS_2_WORKAROUNDS, which would hide the prototype when the option was disabled. The if (IS_ENABLED()would not compile in that case since we would have lacked a visible declaration. We could keep this and just make the prototype unconditionally visible instead.
Quoted 3 lines
I've pondered it a bit more and I'm not entirely happy with the use of a
platform header in generic code in the first place. Would <asm/bugs.h> be a better place for the prototype?
Yes, I like that, fixup coming up for Thomas to apply. Thanks!
Signature · 1 line
Florian
Thomas Bogendoerfer
maintainerQuoted 22 lines · Florian Fainelli
Quoted 8 lines · Maciej W. Rozycki
Quoted 2 lines · Florian Fainelli
The SB1250 SWARM build reports missing prototypes for platform time initialization, SoC setup, IRQ and SMP helpers, and both RTC backends.
Thank you for doing this. I've meant to for a long time, but have been
distracted with higher priority stuff.Quoted 12 lines
arch/mips/mm/tlbex.c static inline int r4k_250MHZhwbug(void) · line 97
Quoted 10 lines
static inline int __maybe_unused bcm1250_m3_war(void) {arch/mips/mm/tlbex.c +4
-2-if (IS_ENABLED (CONFIG_SB1_PASS_2_WORKAROUNDS )) -return sb1250_m3_workaround_needed (); +#ifdef CONFIG_SB1_PASS_2_WORKAROUNDS +return sb1250_m3_workaround_needed (); +#else return 0 ; +#endif }It seems a style regression, why is this change needed?
Quoted 7 lines
The declaration is wrapped under #ifdef
CONFIG_SB1_PASS_2_WORKAROUNDS, which would hide the prototype when the option was disabled. The if (IS_ENABLED()would not compile in that case since we would have lacked a visible declaration. We could keep this and just make the prototype unconditionally visible instead.Thomas, I can send a v3 as an incremental fixup or complete replacement?
incremental fixup please
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]