Skip to contentSkip to conversation

sh: Fix missing prototypes (part three)

PATCH In review Geert Uytterhoeven 2 participants 5 messages May 13, 2024 SuperH

lore
Share & tools
lore
#0 lore raw

cover sh: Fix missing prototypes (part three)

Hi all,

This patch series fixes more "no previous prototype for <foo>" warnings when building a kernel for SuperH, namely when building j2_defconfig.

Thanks for your comments!

Geert Uytterhoeven (3):
sh: of-generic: Add missing #include <asm/clock.h>
sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING
sh: setup: Add missing forward declaration for sh_fdt_init()

 arch/sh/boards/of-generic.c | 2 ++
 arch/sh/include/asm/setup.h | 1 +
 arch/sh/kernel/smp.c        | 2 ++
 3 files changed, 5 insertions(+)
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 Torvalds
#1 lore raw

PATCH 1/3 sh: of-generic: Add missing #include <asm/clock.h>

arch/sh/boards/of-generic.c:146:20: warning: no previous prototype for 'arch_init_clk_ops' [-Wmissing-prototypes]

---
 arch/sh/boards/of-generic.c | 2 ++
 1 file changed, 2 insertions(+)
arch/sh/boards/of-generic.c +2 -0
index f7f3e618e85b6a52..cc88cb8908cc1d2e 100644
@@ -10,6 +10,8 @@
 #include <linux/of_fdt.h>
 #include <linux/clocksource.h>
 #include <linux/irqchip.h>
+
+#include <asm/clock.h>
 #include <asm/machvec.h>
 #include <asm/rtc.h>
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING

In reply to Geert Uytterhoeven

arch/sh/kernel/smp.c:326:5: warning: no previous prototype for 'setup_profiling_timer' [-Wmissing-prototypes]

The function is unconditionally defined in smp.c, but conditionally declared in <linux/profile.h>.

---
 arch/sh/kernel/smp.c | 2 ++
 1 file changed, 2 insertions(+)
arch/sh/kernel/smp.c +2 -0
index b3ea50aabba3d7f2..108d808767fa9984 100644
@@ -322,11 +322,13 @@ void smp_message_recv(unsigned int msg)
 	}
 }
 
+#ifdef CONFIG_PROFILING
 /* Not really SMP stuff ... */
 int setup_profiling_timer(unsigned int multiplier)
 {
 	return 0;
 }
+#endif
 
 #ifdef CONFIG_MMU
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 sh: setup: Add missing forward declaration for sh_fdt_init()

In reply to Geert Uytterhoeven

arch/sh/kernel/setup.c:244:12: warning: no previous prototype for 'sh_fdt_init' [-Wmissing-prototypes]

---
 arch/sh/include/asm/setup.h | 1 +
 1 file changed, 1 insertion(+)
arch/sh/include/asm/setup.h +1 -0
index fc807011187fa1c0..84bb23a771f3538b 100644
@@ -21,5 +21,6 @@
 void sh_mv_setup(void);
 void check_for_initrd(void);
 void per_cpu_trap_init(void);
+void sh_fdt_init(phys_addr_t dt_phys);
 
 #endif /* _SH_SETUP_H */
Signature · 1 line
2.34.1
maintainer Reviewed-by on the v1 series
#4 lore raw
In reply to Geert Uytterhoeven

Hi Geert,

Quoted 12 lines · Geert Uytterhoeven

Hi all,

This patch series fixes more "no previous prototype for <foo>" warnings when building a kernel for SuperH, namely when building j2_defconfig.

Thanks for your comments!

Geert Uytterhoeven (3):
sh: of-generic: Add missing #include <asm/clock.h>
sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING
sh: setup: Add missing forward declaration for sh_fdt_init()

Quoted 4 lines
 arch/sh/boards/of-generic.c | 2 ++
 arch/sh/include/asm/setup.h | 1 +
 arch/sh/kernel/smp.c        | 2 ++
 3 files changed, 5 insertions(+)

Thanks a lot for fixing these. I have run into these as well and except for patch #2 where you found the proper fix, my proposed fixes looked exactly the same.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913