m68k: sun3/3x: Add and use "sun3.h"
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 13 Sep 2023 14:08:42 +0000 (16:08 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Fri, 6 Oct 2023 08:03:04 +0000 (10:03 +0200)
When building with W=1:

    arch/m68k/sun3/idprom.c:86:6: warning: no previous prototype for ‘sun3_get_model’ [-Wmissing-prototypes]
       86 | void sun3_get_model(char *model)
  |      ^~~~~~~~~~~~~~
    arch/m68k/sun3/config.c:53:24: warning: no previous prototype for ‘sun3_init’ [-Wmissing-prototypes]
       53 | asmlinkage void __init sun3_init(void)
  |                        ^~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:117:6: warning: no previous prototype for ‘print_pte_vaddr’ [-Wmissing-prototypes]
      117 | void print_pte_vaddr (unsigned long vaddr)
  |      ^~~~~~~~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:126:13: warning: no previous prototype for ‘mmu_emu_init’ [-Wmissing-prototypes]
      126 | void __init mmu_emu_init(unsigned long bootmem_end)
  |             ^~~~~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:353:5: warning: no previous prototype for ‘mmu_emu_handle_fault’ [-Wmissing-prototypes]
      353 | int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
  |     ^~~~~~~~~~~~~~~~~~~~
    arch/m68k/sun3/leds.c:6:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes]
6 | void sun3_leds(unsigned char byte)
  |      ^~~~~~~~~
    arch/m68k/sun3/intersil.c:27:5: warning: no previous prototype for ‘sun3_hwclk’ [-Wmissing-prototypes]
       27 | int sun3_hwclk(int set, struct rtc_time *t)
  |     ^~~~~~~~~~
    arch/m68k/sun3x/config.c:30:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes]
       30 | void sun3_leds(unsigned char byte)
  |      ^~~~~~~~~

Fix this by introducing a new header file "sun3.h" for holding the
prototypes of functions implemented in arch/m68k/sun3/ and
arch/m68k/sun3x/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/87856ef9ef8955f459fb691faca921c0a688bc80.1694613528.git.geert@linux-m68k.org
arch/m68k/kernel/traps.c
arch/m68k/mm/sun3kmap.c
arch/m68k/mm/sun3mmu.c
arch/m68k/sun3/config.c
arch/m68k/sun3/idprom.c
arch/m68k/sun3/intersil.c
arch/m68k/sun3/leds.c
arch/m68k/sun3/mmu_emu.c
arch/m68k/sun3/sun3.h [new file with mode: 0644]
arch/m68k/sun3/sun3ints.c
arch/m68k/sun3x/config.c

index 129c89349e1a40aa4f9549e7b7882bb8d15d64ba..8ee773d29954921cd7590a6d65454c98687ef734 100644 (file)
@@ -364,7 +364,7 @@ disable_wb:
 #if defined(CONFIG_SUN3)
 #include <asm/sun3mmu.h>
 
-extern int mmu_emu_handle_fault (unsigned long, int, int);
+#include "../sun3/sun3.h"
 
 /* sun3 version of bus_error030 */
 
index 4f2a7ef8348bc1a6c32e9ac42b1f84f1ba7d6041..ac091892d82f8a067ae307379781efe9a3593ef8 100644 (file)
 #include <asm/io.h>
 #include <asm/sun3mmu.h>
 
-#undef SUN3_KMAP_DEBUG
+#include "../sun3/sun3.h"
 
-#ifdef SUN3_KMAP_DEBUG
-extern void print_pte_vaddr(unsigned long vaddr);
-#endif
+#undef SUN3_KMAP_DEBUG
 
 extern void mmu_emu_map_pmeg (int context, int vaddr);
 
index c5e6a23e0262128de2386e65246b52c66510af51..494739c1783e4dea46df2e17c581097aee80ab61 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/machdep.h>
 #include <asm/io.h>
 
-extern void mmu_emu_init (unsigned long bootmem_end);
+#include "../sun3/sun3.h"
 
 const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
 
index 40796c3e84400def5f095d44f3b479c6ccc9fc87..cd8af809e0cad1e4cf48499401fda4abce484f99 100644 (file)
 #include <asm/sun3ints.h>
 #include <asm/config.h>
 
+#include "sun3.h"
+
 char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
 
 static void sun3_sched_init(void);
-extern void sun3_get_model (char* model);
-extern int sun3_hwclk(int set, struct rtc_time *t);
 
 volatile char* clock_va;
 extern unsigned long availmem;
index 9ffd6515ad74a7faba9908c1984492a6f2034b0e..ca633a5f5eb1281a175f2b1964b397e1657678f0 100644 (file)
@@ -17,6 +17,8 @@
 #include <asm/idprom.h>
 #include <asm/machines.h>  /* Fun with Sun released architectures. */
 
+#include "sun3.h"
+
 struct idprom *idprom;
 EXPORT_SYMBOL(idprom);
 
index 8fc74864de81962b1be7ab03acc56c0c7fb53498..29674cfa9bb3aa355572e053e31c60afff0ec7ea 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/intersil.h>
 #include <asm/machdep.h>
 
+#include "sun3.h"
 
 /* bits to set for start/run of the intersil */
 #define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
index 7c67b58ebf13fa4aa7f89d32bd6f5f9d66036792..4bb95318fd5483029de5a66a0762d175b3a54ff6 100644 (file)
@@ -3,6 +3,8 @@
 #include <asm/sun3mmu.h>
 #include <asm/io.h>
 
+#include "sun3.h"
+
 void sun3_leds(unsigned char byte)
 {
        unsigned char dfc;
index 7ec9bbf8a3644a106c1fc40744330497d01800ec..e5a92da43d1978dfe71ffeaf71ef519ed194fefe 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/mmu_context.h>
 #include <asm/dvma.h>
 
+#include "sun3.h"
 
 #undef DEBUG_MMU_EMU
 #define DEBUG_PROM_MAPS
diff --git a/arch/m68k/sun3/sun3.h b/arch/m68k/sun3/sun3.h
new file mode 100644 (file)
index 0000000..8d98c0a
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/linkage.h>
+
+struct rtc_time;
+
+/* config.c */
+asmlinkage void sun3_init(void);
+
+/* idprom.c */
+void sun3_get_model(char *model);
+
+/* intersil.c */
+int sun3_hwclk(int set, struct rtc_time *t);
+
+/* leds.c */
+void sun3_leds(unsigned char byte);
+
+/* mmu_emu.c */
+void mmu_emu_init(unsigned long bootmem_end);
+int mmu_emu_handle_fault(unsigned long vaddr, int read_flag, int kernel_fault);
+void print_pte_vaddr(unsigned long vaddr);
index 36cc280a4505f5d2456b6c917c8c4eb03225a859..781e7c0a6f523a2b321e36a0509eda2607f683d2 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/irq_regs.h>
 #include <linux/seq_file.h>
 
-extern void sun3_leds (unsigned char);
+#include "sun3.h"
 
 void sun3_disable_interrupts(void)
 {
index e2a5d84df6d214d131c508da7719e8ebf74bdb2d..798ea72a0ea3c3e2108e0faa3e89e32cbc9747df 100644 (file)
 #include <asm/config.h>
 
 #include "time.h"
+#include "../sun3/sun3.h"
 
 volatile char *clock_va;
 
-extern void sun3_get_model(char *model);
-
 void sun3_leds(unsigned char byte)
 {