sh: Fix missing prototypes (part two)
cover sh: Fix missing prototypes (part two)
Hi all,
This patch series fixes more "no previous prototype for <foo>" warnings when building a kernel for SuperH, and is a follow-up to [1].
This has been boot-tested on landisk and on qemu/rts7751r2d.
Thanks for your comments!
[1] "[PATCH 00/20] sh: Fix missing prototypes"
https://lore.kernel.org/r/[email protected]>
Geert Uytterhoeven (7):
sh: cache: Move forward declarations to <asm/cacheflush.h>
sh: traps: Make is_dsp_inst() static
sh: mach-highlander: Add missing #include <mach/highlander.h>
sh: mach-sh03: Make sh03_rtc_settimeofday() static
sh: sh7757lcr: Make init_sh7757lcr_IRQ() static
sh: sh7757: Add missing #include <asm/mmzone.h>
sh: sh7785lcr: Make init_sh7785lcr_IRQ() static
arch/sh/boards/board-sh7757lcr.c | 2 +- arch/sh/boards/board-sh7785lcr.c | 2 +- arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 1 + arch/sh/boards/mach-sh03/rtc.c | 2 +- arch/sh/include/asm/cacheflush.h | 12 ++++++++++++ arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +++ arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +++ arch/sh/kernel/traps_32.c | 4 ++-- arch/sh/mm/cache-sh4.c | 2 -- arch/sh/mm/cache-shx3.c | 1 + arch/sh/mm/cache.c | 14 -------------- 12 files changed, 26 insertions(+), 21 deletions(-)
Signature · 12 lines
2.34.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsPATCH 1/7 sh: cache: Move forward declarations to <asm/cacheflush.h>
arch/sh/kernel/cpu/init.c:99:29: warning: no previous prototype for 'l2_cache_init' [-Wmissing-prototypes] arch/sh/kernel/cpu/sh4a/setup-sh7723.c:422:6: warning: no previous prototype for 'l2_cache_init' [-Wmissing-prototypes] arch/sh/kernel/cpu/sh4a/setup-sh7724.c:842:6: warning: no previous prototype for 'l2_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-j2.c:48:13: warning: no previous prototype for 'j2_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-sh2.c:85:13: warning: no previous prototype for 'sh2_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-sh2a.c:181:13: warning: no previous prototype for 'sh2a_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-sh3.c:90:13: warning: no previous prototype for 'sh3_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-sh4.c:384:13: warning: no previous prototype for 'sh4_cache_init' [-Wmissing-prototypes] arch/sh/mm/cache-shx3.c:18:13: warning: no previous prototype for 'shx3_cache_init' [-Wmissing-prototypes] arch/sh/mm/flush-sh4.c:106:13: warning: no previous prototype for 'sh4__flush_region_init' [-Wmissing-prototypes] arch/sh/mm/cache-sh7705.c:190:13: warning: no previous prototype for 'sh7705_cache_init' [-Wmissing-prototypes]
Fix this by moving all cache-related forward declarations to <asm/cacheflush.h>, and by including the latter where needed.
--- arch/sh/include/asm/cacheflush.h | 12 ++++++++++++ arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +++ arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 + arch/sh/mm/cache-sh4.c | 2 -- arch/sh/mm/cache-shx3.c | 1 + arch/sh/mm/cache.c | 14 -------------- 6 files changed, 17 insertions(+), 16 deletions(-)
arch/sh/include/asm/cacheflush.h +12 -0
@@ -104,6 +104,18 @@ void kunmap_coherent(void *kvaddr);void cpu_cache_init (void ); +void __weak l2_cache_init (void ); + +void __weak j2_cache_init (void ); +void __weak sh2_cache_init (void ); +void __weak sh2a_cache_init (void ); +void __weak sh3_cache_init (void ); +void __weak shx3_cache_init (void ); +void __weak sh4_cache_init (void ); +void __weak sh7705_cache_init (void ); + +void __weak sh4__flush_region_init (void ); +static inline void *sh_cacheop_vaddr (void *vaddr) {if (__in_29bit_mode ())
arch/sh/kernel/cpu/sh4a/setup-sh7723.c +3 -0
@@ -14,9 +14,12 @@#include <linux/sh_timer.h> #include <linux/sh_intc.h> #include <linux/io.h> + +#include <asm/cacheflush.h> #include <asm/clock.h> #include <asm/mmzone.h> #include <asm/platform_early.h> +#include <cpu/sh7723.h> /* Serial */
arch/sh/kernel/cpu/sh4a/setup-sh7724.c +1 -0
@@ -21,6 +21,7 @@#include <linux/io.h> #include <linux/notifier.h> +#include <asm/cacheflush.h> #include <asm/suspend.h> #include <asm/clock.h> #include <asm/mmzone.h>
arch/sh/mm/cache-sh4.c +0 -2
@@ -376,8 +376,6 @@ static void __flush_cache_one(unsigned long addr, unsigned long phys, }while (--way_count !=0 ); } -extern void __weak sh4__flush_region_init (void ); -/* * SH-4 has virtually indexed and physically tagged cache. */
arch/sh/mm/cache-shx3.c +1 -0
@@ -11,6 +11,7 @@#include <linux/kernel.h> #include <linux/io.h> #include <asm/cache.h> +#include <asm/cacheflush.h> #define CCR_CACHE_SNM 0x40000/* Hardware-assisted synonym avoidance */ #define CCR_CACHE_IBE 0x1000000/* ICBI broadcast */
arch/sh/mm/cache.c +0 -14
@@ -320,30 +320,20 @@ void __init cpu_cache_init(void) goto skip;if (boot_cpu_data.type ==CPU_J2 ) { -extern void __weak j2_cache_init (void ); -j2_cache_init (); }else if (boot_cpu_data.family ==CPU_FAMILY_SH2 ) { -extern void __weak sh2_cache_init (void ); -sh2_cache_init (); }if (boot_cpu_data.family ==CPU_FAMILY_SH2A ) { -extern void __weak sh2a_cache_init (void ); -sh2a_cache_init (); }if (boot_cpu_data.family ==CPU_FAMILY_SH3 ) { -extern void __weak sh3_cache_init (void ); -sh3_cache_init ();if ((boot_cpu_data.type ==CPU_SH7705 ) && (boot_cpu_data.dcache.sets ==512 )) { -extern void __weak sh7705_cache_init (void ); -sh7705_cache_init (); } }
@@ -351,14 +341,10 @@ void __init cpu_cache_init(void)if ((boot_cpu_data.family ==CPU_FAMILY_SH4 ) || (boot_cpu_data.family ==CPU_FAMILY_SH4A ) || (boot_cpu_data.family ==CPU_FAMILY_SH4AL_DSP )) { -extern void __weak sh4_cache_init (void ); -sh4_cache_init ();if ((boot_cpu_data.type ==CPU_SH7786 ) || (boot_cpu_data.type ==CPU_SHX3 )) { -extern void __weak shx3_cache_init (void ); -shx3_cache_init (); } }
Signature · 1 line
2.34.1
PATCH 2/7 sh: traps: Make is_dsp_inst() static
In reply to Geert UytterhoevenIf CONFIG_SH_DSP=y (e.g. se7343_defconfig):
arch/sh/kernel/traps_32.c:572:5: warning: no previous prototype for ‘is_dsp_inst’ [-Wmissing-prototypes]
There are no users outside this file, so make it static.
While at it, convert the dummy for the CONFIG_SH_DSP=n case from a macro to a static inline function, to increase type-safety.
--- arch/sh/kernel/traps_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sh/kernel/traps_32.c +2 -2
@@ -569,7 +569,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,/* * SH-DSP support [email protected]. */ -int is_dsp_inst (struct pt_regs *regs) +static int is_dsp_inst (struct pt_regs *regs) {unsigned short inst =0 ;
@@ -591,7 +591,7 @@ int is_dsp_inst(struct pt_regs *regs) return 0; }#else -#define is_dsp_inst (regs) (0) +static inline int is_dsp_inst (struct pt_regs *regs) {return 0 ; }#endif /* CONFIG_SH_DSP */ #ifdef CONFIG_CPU_SH2A
Signature · 1 line
2.34.1
PATCH 3/7 sh: mach-highlander: Add missing #include <mach/highlander.h>
In reply to Geert Uytterhoevenarch/sh/boards/mach-highlander/pinmux-r7785rp.c:9:13: warning: no previous prototype for ‘highlander_plat_pinmux_setup’ [-Wmissing-prototypes]
--- arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 1 + 1 file changed, 1 insertion(+)
arch/sh/boards/mach-highlander/pinmux-r7785rp.c +1 -0
@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/gpio.h> #include <cpu/sh7785.h> +#include <mach/highlander.h> void __init highlander_plat_pinmux_setup (void ) {
Signature · 1 line
2.34.1
PATCH 4/7 sh: mach-sh03: Make sh03_rtc_settimeofday() static
In reply to Geert Uytterhoevenarch/sh/boards/mach-sh03/rtc.c:123:5: warning: no previous prototype for ‘sh03_rtc_settimeofday’ [-Wmissing-prototypes]
There are no users outside this file, so make it static.
--- arch/sh/boards/mach-sh03/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/boards/mach-sh03/rtc.c +1 -1
@@ -120,7 +120,7 @@ static int set_rtc_mmss(struct rtc_time *tm)return retval; } -int sh03_rtc_settimeofday (struct device *dev,struct rtc_time *tm) +static int sh03_rtc_settimeofday (struct device *dev,struct rtc_time *tm) {return set_rtc_mmss (tm); }
Signature · 1 line
2.34.1
PATCH 5/7 sh: sh7757lcr: Make init_sh7757lcr_IRQ() static
In reply to Geert Uytterhoevenarch/sh/boards/board-sh7757lcr.c:572:13: warning: no previous prototype for 'init_sh7757lcr_IRQ' [-Wmissing-prototypes]
There are no users outside this file, so make it static.
--- arch/sh/boards/board-sh7757lcr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/boards/board-sh7757lcr.c +1 -1
@@ -569,7 +569,7 @@ static int __init sh7757lcr_devices_setup(void)arch_initcall (sh7757lcr_devices_setup);/* Initialize IRQ setting */ -void __init init_sh7757lcr_IRQ (void ) +static void __init init_sh7757lcr_IRQ (void ) {plat_irq_setup_pins (IRQ_MODE_IRQ7654 );plat_irq_setup_pins (IRQ_MODE_IRQ3210 );
Signature · 1 line
2.34.1
PATCH 6/7 sh: sh7757: Add missing #include <asm/mmzone.h>
In reply to Geert Uytterhoevenarch/sh/kernel/cpu/sh4a/setup-sh7757.c:1240:13: warning: no previous prototype for ‘plat_mem_setup’ [-Wmissing-prototypes]
--- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +++ 1 file changed, 3 insertions(+)
arch/sh/kernel/cpu/sh4a/setup-sh7757.c +3 -0
@@ -17,8 +17,11 @@#include <linux/sh_dma.h> #include <linux/sh_intc.h> #include <linux/usb/ohci_pdriver.h> +#include <cpu/dma-register.h> #include <cpu/sh7757.h> + +#include <asm/mmzone.h> #include <asm/platform_early.h> static struct plat_sci_port scif2_platform_data = {
Signature · 1 line
2.34.1
PATCH 7/7 sh: sh7785lcr: Make init_sh7785lcr_IRQ() static
In reply to Geert Uytterhoevenarch/sh/boards/board-sh7785lcr.c:298:13: warning: no previous prototype for ‘init_sh7785lcr_IRQ’ [-Wmissing-prototypes]
There are no users outside this file, so make it static.
--- arch/sh/boards/board-sh7785lcr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/boards/board-sh7785lcr.c +1 -1
@@ -295,7 +295,7 @@ static int __init sh7785lcr_devices_setup(void)device_initcall (sh7785lcr_devices_setup);/* Initialize IRQ setting */ -void __init init_sh7785lcr_IRQ (void ) +static void __init init_sh7785lcr_IRQ (void ) {plat_irq_setup_pins (IRQ_MODE_IRQ7654 );plat_irq_setup_pins (IRQ_MODE_IRQ3210 );
Signature · 1 line
2.34.1
Hi Geert,
Quoted 21 lines · Geert Uytterhoeven
Hi all,
This patch series fixes more "no previous prototype for <foo>" warnings when building a kernel for SuperH, and is a follow-up to [1].
This has been boot-tested on landisk and on qemu/rts7751r2d.
Thanks for your comments!
[1] "[PATCH 00/20] sh: Fix missing prototypes"
https://lore.kernel.org/r/[email protected]>Geert Uytterhoeven (7):
sh: cache: Move forward declarations to <asm/cacheflush.h>
sh: traps: Makeis_dsp_inst()static
sh: mach-highlander: Add missing #include <mach/highlander.h>
sh: mach-sh03: Makesh03_rtc_settimeofday()static
sh: sh7757lcr: Makeinit_sh7757lcr_IRQ()static
sh: sh7757: Add missing #include <asm/mmzone.h>
sh: sh7785lcr: Makeinit_sh7785lcr_IRQ()static
Quoted 13 lines
arch/sh/boards/board-sh7757lcr.c | 2 +- arch/sh/boards/board-sh7785lcr.c | 2 +- arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 1 + arch/sh/boards/mach-sh03/rtc.c | 2 +- arch/sh/include/asm/cacheflush.h | 12 ++++++++++++ arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +++ arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +++ arch/sh/kernel/traps_32.c | 4 ++-- arch/sh/mm/cache-sh4.c | 2 -- arch/sh/mm/cache-shx3.c | 1 + arch/sh/mm/cache.c | 14 -------------- 12 files changed, 26 insertions(+), 21 deletions(-)
All patches look good to me, so for the whole series:
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 21 lines · Geert Uytterhoeven
Hi all,
This patch series fixes more "no previous prototype for <foo>" warnings when building a kernel for SuperH, and is a follow-up to [1].
This has been boot-tested on landisk and on qemu/rts7751r2d.
Thanks for your comments!
[1] "[PATCH 00/20] sh: Fix missing prototypes"
https://lore.kernel.org/r/[email protected]>Geert Uytterhoeven (7):
sh: cache: Move forward declarations to <asm/cacheflush.h>
sh: traps: Makeis_dsp_inst()static
sh: mach-highlander: Add missing #include <mach/highlander.h>
sh: mach-sh03: Makesh03_rtc_settimeofday()static
sh: sh7757lcr: Makeinit_sh7757lcr_IRQ()static
sh: sh7757: Add missing #include <asm/mmzone.h>
sh: sh7785lcr: Makeinit_sh7785lcr_IRQ()static
Quoted 13 lines
arch/sh/boards/board-sh7757lcr.c | 2 +- arch/sh/boards/board-sh7785lcr.c | 2 +- arch/sh/boards/mach-highlander/pinmux-r7785rp.c | 1 + arch/sh/boards/mach-sh03/rtc.c | 2 +- arch/sh/include/asm/cacheflush.h | 12 ++++++++++++ arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 3 +++ arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 1 + arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 3 +++ arch/sh/kernel/traps_32.c | 4 ++-- arch/sh/mm/cache-sh4.c | 2 -- arch/sh/mm/cache-shx3.c | 1 + arch/sh/mm/cache.c | 14 -------------- 12 files changed, 26 insertions(+), 21 deletions(-)
Applied to my sh-linux tree in the for-next branch.
Thanks,
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913