mips: move cache declarations into header
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Dec 2023 11:57:02 +0000 (12:57 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:41 +0000 (17:21 -0800)
Some of the cache functions are declared only for their callers, e.g.

arch/mips/mm/c-r3k.c:28:15: error: no previous prototype for 'r3k_cache_size' [-Werror=missing-prototypes]
arch/mips/mm/c-r3k.c:63:15: error: no previous prototype for 'r3k_cache_lsize' [-Werror=missing-prototypes]
arch/mips/mm/c-r4k.c:1703:6: error: no previous prototype for 'r4k_cache_init' [-Werror=missing-prototypes]
arch/mips/mm/sc-mips.c:255:5: error: no previous prototype for 'mips_sc_init' [-Werror=missing-prototypes]

Move all the declarations to asm/cache.h and asm/r4kcache.h where they
can be seen by the function definitions.

Link: https://lkml.kernel.org/r/20231204115710.2247097-13-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Rothwell <sfr@rothwell.id.au>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/mips/include/asm/cache.h
arch/mips/include/asm/r4kcache.h
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/cpu-r3k-probe.c
arch/mips/mm/c-r4k.c
arch/mips/mm/cache.c

index 3424a7908c0fa317dfe9b1d1a00e1524cf864593..8b08db3fb17aae4f0987092414f9b8ffe59fd8df 100644 (file)
 #define __read_mostly __section(".data..read_mostly")
 
 extern void cache_noop(void);
+extern void r3k_cache_init(void);
+extern unsigned long r3k_cache_size(unsigned long);
+extern unsigned long r3k_cache_lsize(unsigned long);
+extern void r4k_cache_init(void);
+extern void octeon_cache_init(void);
+extern void au1x00_fixup_config_od(void);
 
 #endif /* _ASM_CACHE_H */
index 431a1c9d53fc7124d6f898bedcd0d6a3b1f760d3..da1cd1bbdbc5d1e85e1e418386678a24876d89eb 100644 (file)
 #include <asm/mmzone.h>
 #include <asm/unroll.h>
 
+extern void r5k_sc_init(void);
+extern void rm7k_sc_init(void);
+extern int mips_sc_init(void);
+
 extern void (*r4k_blast_dcache)(void);
 extern void (*r4k_blast_icache)(void);
 
index b406d8bfb15a36b18844b843a5906487f84a6b23..de7460c3a72e914b573e7b2680dbd9d56866f58f 100644 (file)
@@ -179,7 +179,6 @@ void __init check_bugs32(void)
 static inline int cpu_has_confreg(void)
 {
 #ifdef CONFIG_CPU_R3000
-       extern unsigned long r3k_cache_size(unsigned long);
        unsigned long size1, size2;
        unsigned long cfg = read_c0_conf();
 
index be93469c0e0eca4fc59ae9f2594740d1d660d067..0c826f729f7527d5eabdd5416cf6afc174307801 100644 (file)
@@ -42,7 +42,6 @@ void __init check_bugs32(void)
 static inline int cpu_has_confreg(void)
 {
 #ifdef CONFIG_CPU_R3000
-       extern unsigned long r3k_cache_size(unsigned long);
        unsigned long size1, size2;
        unsigned long cfg = read_c0_conf();
 
index 0619e5296ff3fa2adeacca541eac9fca495a388a..b45bf026ee55e662f328ca4dc162b1365afd3563 100644 (file)
@@ -1485,10 +1485,6 @@ static void loongson3_sc_init(void)
        return;
 }
 
-extern int r5k_sc_init(void);
-extern int rm7k_sc_init(void);
-extern int mips_sc_init(void);
-
 static void setup_scache(void)
 {
        struct cpuinfo_mips *c = &current_cpu_data;
index 7f830634dbe7dbb7a1ca2507e3b094bb9bfd5027..e5d19f4a38ba5d917dbd1b84299fc65e7cd2818e 100644 (file)
@@ -206,19 +206,13 @@ static inline void setup_protection_map(void)
 void cpu_cache_init(void)
 {
        if (cpu_has_3k_cache) {
-               extern void __weak r3k_cache_init(void);
-
                r3k_cache_init();
        }
        if (cpu_has_4k_cache) {
-               extern void __weak r4k_cache_init(void);
-
                r4k_cache_init();
        }
 
        if (cpu_has_octeon_cache) {
-               extern void __weak octeon_cache_init(void);
-
                octeon_cache_init();
        }