Skip to contentSkip to conversation

Fix W=1 builds on sparc

PATCH New Matthew Wilcox 1 participant 1 message Nov 8, 2021 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix W=1 builds on sparc

Running the following command:

$ make W=1 O=.sparc ARCH=sparc64 CROSS_COMPILE=sparc64-linux-gnu- mm/util.o

CC arch/sparc/kernel/asm-offsets.s
../arch/sparc/kernel/asm-offsets.c:29:5: error: no previous prototype for ‘sparc64_foo’ [-Werror=missing-prototypes] ../arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for ‘foo’ [-Werror=missing-prototypes]

These functions obviously aren't actually called from anywhere, so just silence the warning (and fix the build) by declaring them immediately before defining them.

arch/sparc/kernel/asm-offsets.c +3 -0
index 5784f2df489a..354a4d4d7b37 100644
@@ -19,6 +19,7 @@
 #include <asm/hibernate.h>
 
 #ifdef CONFIG_SPARC32
+int sparc32_foo(void);
 int sparc32_foo(void)
 {
 	DEFINE(AOFF_thread_fork_kpsr,
@@ -26,6 +27,7 @@ int sparc32_foo(void)
 	return 0;
 }
 #else
+int sparc64_foo(void);
 int sparc64_foo(void)
 {
 #ifdef CONFIG_HIBERNATION
@@ -45,6 +47,7 @@ int sparc64_foo(void)
 }
 #endif
 
+int foo(void);
 int foo(void)
 {
 	BLANK();