Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mips: move cache declarations into header

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>

authored by

Arnd Bergmann and committed by
Andrew Morton
66445677 ec47b986

+10 -12
+6
arch/mips/include/asm/cache.h
··· 17 17 #define __read_mostly __section(".data..read_mostly") 18 18 19 19 extern void cache_noop(void); 20 + extern void r3k_cache_init(void); 21 + extern unsigned long r3k_cache_size(unsigned long); 22 + extern unsigned long r3k_cache_lsize(unsigned long); 23 + extern void r4k_cache_init(void); 24 + extern void octeon_cache_init(void); 25 + extern void au1x00_fixup_config_od(void); 20 26 21 27 #endif /* _ASM_CACHE_H */
+4
arch/mips/include/asm/r4kcache.h
··· 24 24 #include <asm/mmzone.h> 25 25 #include <asm/unroll.h> 26 26 27 + extern void r5k_sc_init(void); 28 + extern void rm7k_sc_init(void); 29 + extern int mips_sc_init(void); 30 + 27 31 extern void (*r4k_blast_dcache)(void); 28 32 extern void (*r4k_blast_icache)(void); 29 33
-1
arch/mips/kernel/cpu-probe.c
··· 179 179 static inline int cpu_has_confreg(void) 180 180 { 181 181 #ifdef CONFIG_CPU_R3000 182 - extern unsigned long r3k_cache_size(unsigned long); 183 182 unsigned long size1, size2; 184 183 unsigned long cfg = read_c0_conf(); 185 184
-1
arch/mips/kernel/cpu-r3k-probe.c
··· 42 42 static inline int cpu_has_confreg(void) 43 43 { 44 44 #ifdef CONFIG_CPU_R3000 45 - extern unsigned long r3k_cache_size(unsigned long); 46 45 unsigned long size1, size2; 47 46 unsigned long cfg = read_c0_conf(); 48 47
-4
arch/mips/mm/c-r4k.c
··· 1485 1485 return; 1486 1486 } 1487 1487 1488 - extern int r5k_sc_init(void); 1489 - extern int rm7k_sc_init(void); 1490 - extern int mips_sc_init(void); 1491 - 1492 1488 static void setup_scache(void) 1493 1489 { 1494 1490 struct cpuinfo_mips *c = &current_cpu_data;
-6
arch/mips/mm/cache.c
··· 206 206 void cpu_cache_init(void) 207 207 { 208 208 if (cpu_has_3k_cache) { 209 - extern void __weak r3k_cache_init(void); 210 - 211 209 r3k_cache_init(); 212 210 } 213 211 if (cpu_has_4k_cache) { 214 - extern void __weak r4k_cache_init(void); 215 - 216 212 r4k_cache_init(); 217 213 } 218 214 219 215 if (cpu_has_octeon_cache) { 220 - extern void __weak octeon_cache_init(void); 221 - 222 216 octeon_cache_init(); 223 217 } 224 218