diff mbox series

Fix W=1 builds on sparc

Message ID YYiJMeWiCgK8ECGP@casper.infradead.org
State New
Headers show
Series Fix W=1 builds on sparc | expand

Commit Message

Matthew Wilcox Nov. 8, 2021, 2:19 a.m. UTC
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.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
diff mbox series

Patch

diff --git a/arch/sparc/kernel/asm-offsets.c b/arch/sparc/kernel/asm-offsets.c
index 5784f2df489a..354a4d4d7b37 100644
--- a/arch/sparc/kernel/asm-offsets.c
+++ b/arch/sparc/kernel/asm-offsets.c
@@ -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();