]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sh: cache: Move forward declarations to <asm/cacheflush.h>
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 4 Mar 2024 19:10:43 +0000 (20:10 +0100)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 2 May 2024 10:01:31 +0000 (12:01 +0200)
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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/f47ab87636d16db4c47bebe1bf62650045f61989.1709579038.git.geert+renesas@glider.be
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
arch/sh/include/asm/cacheflush.h
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
arch/sh/mm/cache-sh4.c
arch/sh/mm/cache-shx3.c
arch/sh/mm/cache.c

index 51112f54552b329a307577a5a047f97172d56381..e6642ff148898becffa764a9ffd11a7f6d2c17ff 100644 (file)
@@ -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())
index 83ae1ad4a86e86b710cf5872d9fd68693f41557c..d64d28c4f0595d60dfa78c5c154d337a91057e44 100644 (file)
 #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 */
index 0d990ab1ba2a9ed743e0fa9fa1d627352e141312..ef4b26a4b3d6428c3d558323a246180cf3aa6ee5 100644 (file)
@@ -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>
index 862046f26981b61d4938c490ae0e09dff968cb26..195e739ee2be77d8a8d9a0a561608578c1c691ce 100644 (file)
@@ -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.
  */
index 24c58b7dc02265c795000fa997ac96da59207175..dec039a75664083f62bf1f8438ecf50e087f8e37 100644 (file)
@@ -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 */
index 9bcaa5619eabd142c0d679eaeb4874fad105fe2d..ceffd3ffc81e3ee24258a5045867192756e14a60 100644 (file)
@@ -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();
                }
        }