linux-next: build failure after merge of the mm tree

Message ID 20231127144418.54daad5d@canb.auug.org.au
State New
Headers
Series linux-next: build failure after merge of the mm tree |

Commit Message

Stephen Rothwell Nov. 27, 2023, 3:44 a.m. UTC
  Hi all,

After merging the mm tree, today's linux-next build (sparc64 defconfig)
failed like this:

arch/sparc/vdso/vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
  254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
      | ^~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes]
  282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes]
  307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
      | ^~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes]
  343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vma.c:246:12: warning: no previous prototype for 'init_vdso_image' [-Wmissing-prototypes]
  246 | int __init init_vdso_image(const struct vdso_image *image,
      |            ^~~~~~~~~~~~~~~
arch/sparc/prom/p1275.c:52:6: warning: no previous prototype for 'prom_cif_init' [-Wmissing-prototypes]
   52 | void prom_cif_init(void *cif_handler, void *cif_stack)
      |      ^~~~~~~~~~~~~
In file included from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
  254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
      | ^~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes]
  282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes]
  307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
      | ^~~~~~~~~~~~~~~~~~~
arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes]
  343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/prom/misc_64.c:165:5: warning: no previous prototype for 'prom_get_mmu_ihandle' [-Wmissing-prototypes]
  165 | int prom_get_mmu_ihandle(void)
      |     ^~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/traps_64.c:253:6: error: no previous prototype for 'is_no_fault_exception' [-Werror=missing-prototypes]
  253 | bool is_no_fault_exception(struct pt_regs *regs)
      |      ^~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/traps_64.c:2035:6: error: no previous prototype for 'do_mcd_err' [-Werror=missing-prototypes]
 2035 | void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
      |      ^~~~~~~~~~
arch/sparc/kernel/traps_64.c:2153:6: error: no previous prototype for 'sun4v_nonresum_error_user_handled' [-Werror=missing-prototypes]
 2153 | bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
arch/sparc/mm/init_64.c:2644:6: error: no previous prototype for 'vmemmap_free' [-Werror=missing-prototypes]
 2644 | void vmemmap_free(unsigned long start, unsigned long end,
      |      ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Caused by commit

  c6345dfa6e3e ("Makefile.extrawarn: turn on missing-prototypes globally")

I applied the following hack for today.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 27 Nov 2023 14:18:45 +1100
Subject: [PATCH] sparc: turn off Werror for now

---
 arch/sparc/kernel/Makefile | 2 +-
 arch/sparc/mm/Makefile     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Stephen Rothwell Dec. 22, 2023, 12:16 a.m. UTC | #1
Hi all,

On Mon, 27 Nov 2023 14:44:18 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the mm tree, today's linux-next build (sparc64 defconfig)
> failed like this:
> 
> arch/sparc/vdso/vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
>   254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
>       | ^~~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes]
>   282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes]
>   307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
>       | ^~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes]
>   343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vma.c:246:12: warning: no previous prototype for 'init_vdso_image' [-Wmissing-prototypes]
>   246 | int __init init_vdso_image(const struct vdso_image *image,
>       |            ^~~~~~~~~~~~~~~
> arch/sparc/prom/p1275.c:52:6: warning: no previous prototype for 'prom_cif_init' [-Wmissing-prototypes]
>    52 | void prom_cif_init(void *cif_handler, void *cif_stack)
>       |      ^~~~~~~~~~~~~
> In file included from arch/sparc/vdso/vdso32/vclock_gettime.c:22:
> arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
>   254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
>       | ^~~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes]
>   282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes]
>   307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
>       | ^~~~~~~~~~~~~~~~~~~
> arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes]
>   343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/sparc/prom/misc_64.c:165:5: warning: no previous prototype for 'prom_get_mmu_ihandle' [-Wmissing-prototypes]
>   165 | int prom_get_mmu_ihandle(void)
>       |     ^~~~~~~~~~~~~~~~~~~~
> arch/sparc/kernel/traps_64.c:253:6: error: no previous prototype for 'is_no_fault_exception' [-Werror=missing-prototypes]
>   253 | bool is_no_fault_exception(struct pt_regs *regs)
>       |      ^~~~~~~~~~~~~~~~~~~~~
> arch/sparc/kernel/traps_64.c:2035:6: error: no previous prototype for 'do_mcd_err' [-Werror=missing-prototypes]
>  2035 | void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
>       |      ^~~~~~~~~~
> arch/sparc/kernel/traps_64.c:2153:6: error: no previous prototype for 'sun4v_nonresum_error_user_handled' [-Werror=missing-prototypes]
>  2153 | bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
>       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> arch/sparc/mm/init_64.c:2644:6: error: no previous prototype for 'vmemmap_free' [-Werror=missing-prototypes]
>  2644 | void vmemmap_free(unsigned long start, unsigned long end,
>       |      ^~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Caused by commit
> 
>   c6345dfa6e3e ("Makefile.extrawarn: turn on missing-prototypes globally")
> 
> I applied the following hack for today.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 27 Nov 2023 14:18:45 +1100
> Subject: [PATCH] sparc: turn off Werror for now
> 
> ---
>  arch/sparc/kernel/Makefile | 2 +-
>  arch/sparc/mm/Makefile     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
> index 0984bb6f0f17..1ce4d5028c86 100644
> --- a/arch/sparc/kernel/Makefile
> +++ b/arch/sparc/kernel/Makefile
> @@ -5,7 +5,7 @@
>  #
>  
>  asflags-y := -ansi
> -ccflags-y := -Werror
> +#ccflags-y := -Werror
>  
>  # Undefine sparc when processing vmlinux.lds - it is used
>  # And teach CPP we are doing $(BITS) builds (for this case)
> diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile
> index 871354aa3c00..a199484e131f 100644
> --- a/arch/sparc/mm/Makefile
> +++ b/arch/sparc/mm/Makefile
> @@ -3,7 +3,7 @@
>  #
>  
>  asflags-y := -ansi
> -ccflags-y := -Werror
> +#ccflags-y := -Werror
>  
>  obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o
>  obj-y                   += fault_$(BITS).o
> -- 
> 2.40.1
> 
> After which I got these as well:
> 
> arch/sparc/kernel/adi_64.c:124:21: warning: no previous prototype for 'find_tag_store' [-Wmissing-prototypes]
>   124 | tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
>       |                     ^~~~~~~~~~~~~~
> arch/sparc/kernel/adi_64.c:156:21: warning: no previous prototype for 'alloc_tag_store' [-Wmissing-prototypes]
>   156 | tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
>       |                     ^~~~~~~~~~~~~~~
> arch/sparc/kernel/adi_64.c:299:6: warning: no previous prototype for 'del_tag_store' [-Wmissing-prototypes]
>   299 | void del_tag_store(tag_storage_desc_t *tag_desc, struct mm_struct *mm)
>       |      ^~~~~~~~~~~~~
> arch/sparc/kernel/uprobes.c:237:17: warning: no previous prototype for 'uprobe_trap' [-Wmissing-prototypes]
>   237 | asmlinkage void uprobe_trap(struct pt_regs *regs,
>       |                 ^~~~~~~~~~~
> arch/sparc/kernel/time_64.c:880:20: warning: no previous prototype for 'sched_clock' [-Wmissing-prototypes]
>   880 | unsigned long long sched_clock(void)
>       |                    ^~~~~~~~~~~
> arch/sparc/kernel/pci_sun4v.c:259:15: warning: no previous prototype for 'dma_4v_iotsb_bind' [-Wmissing-prototypes]
>   259 | unsigned long dma_4v_iotsb_bind(unsigned long devhandle,
>       |               ^~~~~~~~~~~~~~~~~
> arch/sparc/kernel/setup_64.c:602:13: warning: no previous prototype for 'alloc_irqstack_bootmem' [-Wmissing-prototypes]
>   602 | void __init alloc_irqstack_bootmem(void)
>       |             ^~~~~~~~~~~~~~~~~~~~~~
> 
> And these from the sparc (32) defconfig build:
> 
> arch/sparc/lib/cmpdi2.c:6:11: error: no previous prototype for '__cmpdi2' [-Werror=missing-prototypes]
>     6 | word_type __cmpdi2(long long a, long long b)
>       |           ^~~~~~~~
> cc1: all warnings being treated as errors
> kernel/dma.c:70:5: warning: no previous prototype for 'request_dma' [-Wmissing-prototypes]
>    70 | int request_dma(unsigned int dmanr, const char * device_id)
>       |     ^~~~~~~~~~~
> kernel/dma.c:88:6: warning: no previous prototype for 'free_dma' [-Wmissing-prototypes]
>    88 | void free_dma(unsigned int dmanr)
>       |      ^~~~~~~~
> 
> So I turned off -Werrror in the lib directory as well which added this:
> 
> arch/sparc/lib/ucmpdi2.c:5:11: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes]
>     5 | word_type __ucmpdi2(unsigned long long a, unsigned long long b)
>       |           ^~~~~~~~~

Is anything being done about the above warnings?
  
Andrew Morton Dec. 22, 2023, 6:26 a.m. UTC | #2
On Fri, 22 Dec 2023 11:16:49 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi all,
> 
> On Mon, 27 Nov 2023 14:44:18 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > After merging the mm tree, today's linux-next build (sparc64 defconfig)
> > failed like this:
> > 
> > arch/sparc/vdso/vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes]
> >   254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
> > 
>
> ...
>
> > So I turned off -Werrror in the lib directory as well which added this:
> > 
> > arch/sparc/lib/ucmpdi2.c:5:11: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes]
> >     5 | word_type __ucmpdi2(unsigned long long a, unsigned long long b)
> >       |           ^~~~~~~~~
> 
> Is anything being done about the above warnings?

OK, here's sparc64.  I'll do sparc32 in a bit.


From: Andrew Morton <akpm@linux-foundation.org>
Subject: sparc64: fix up fallout from enabling -Wmissing-prototypes
Date: Thu Dec 21 04:33:25 PM PST 2023

Fix sparc64 allmodconfig build errors caused by enabling
-Wmissing-prototypes.

- Symbols only used from assembly were given local prototypes

- A couple of missing inclusions were added

- Define some functions to be static

- vmemmap_free() is only needed if CONFIG_MEMORY_HOTPLUG

- add new arch/sparc/include/asm/irq_work.h for arch_irq_work_raise()

- move prom_cif_init() prototype to header, fix longstanding
  prom_cif_init() borkage.

- various function declarations were moved from .c into shared .h

Fixes: c6345dfa6e3e ("Makefile.extrawarn: turn on missing-prototypes globally")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sparc/include/asm/floppy_64.h |    4 +++-
 arch/sparc/include/asm/irq_work.h  |   10 ++++++++++
 arch/sparc/include/asm/openprom.h  |    2 ++
 arch/sparc/kernel/adi_64.c         |    6 +++---
 arch/sparc/kernel/asm-offsets.c    |    4 +++-
 arch/sparc/kernel/pci_sun4v.c      |    2 +-
 arch/sparc/kernel/setup_64.c       |    2 +-
 arch/sparc/kernel/time_64.c        |    2 ++
 arch/sparc/kernel/traps_64.c       |    7 ++++---
 arch/sparc/kernel/uprobes.c        |    1 +
 arch/sparc/mm/init_64.c            |    2 ++
 arch/sparc/power/hibernate.c       |    1 +
 arch/sparc/prom/init_64.c          |    2 --
 arch/sparc/prom/misc_64.c          |    2 +-
 arch/sparc/prom/p1275.c            |    2 +-
 arch/sparc/vdso/vclock_gettime.c   |   10 ++++++++++
 arch/sparc/vdso/vma.c              |    2 +-
 drivers/mtd/maps/sun_uflash.c      |    2 +-
 drivers/sbus/char/bbc_i2c.c        |    3 ---
 drivers/sbus/char/bbc_i2c.h        |    3 +++
 20 files changed, 50 insertions(+), 19 deletions(-)

--- a/arch/sparc/vdso/vclock_gettime.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/vdso/vclock_gettime.c
@@ -250,6 +250,8 @@ notrace static int do_monotonic_coarse(s
 	return 0;
 }
 
+int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts);
+
 notrace int
 __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
 {
@@ -278,6 +280,9 @@ int
 clock_gettime(clockid_t, struct __kernel_old_timespec *)
 	__attribute__((weak, alias("__vdso_clock_gettime")));
 
+int
+__vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts);
+
 notrace int
 __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts)
 {
@@ -303,6 +308,8 @@ __vdso_clock_gettime_stick(clockid_t clo
 	return vdso_fallback_gettime(clock, ts);
 }
 
+int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
+
 notrace int
 __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
@@ -339,6 +346,9 @@ int
 gettimeofday(struct __kernel_old_timeval *, struct timezone *)
 	__attribute__((weak, alias("__vdso_gettimeofday")));
 
+int
+__vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz);
+
 notrace int
 __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
--- a/arch/sparc/kernel/asm-offsets.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/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();
@@ -57,4 +60,3 @@ int foo(void)
 	/* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
 	return 0;
 }
-
--- a/arch/sparc/prom/misc_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/prom/misc_64.c
@@ -162,7 +162,7 @@ unsigned char prom_get_idprom(char *idbu
 	return 0xff;
 }
 
-int prom_get_mmu_ihandle(void)
+static int prom_get_mmu_ihandle(void)
 {
 	phandle node;
 	int ret;
--- a/arch/sparc/kernel/traps_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/traps_64.c
@@ -22,6 +22,7 @@
 #include <linux/kdebug.h>
 #include <linux/ftrace.h>
 #include <linux/reboot.h>
+#include <linux/cpu.h>
 #include <linux/gfp.h>
 #include <linux/context_tracking.h>
 
@@ -249,7 +250,7 @@ void sun4v_insn_access_exception_tl1(str
 	sun4v_insn_access_exception(regs, addr, type_ctx);
 }
 
-bool is_no_fault_exception(struct pt_regs *regs)
+static bool is_no_fault_exception(struct pt_regs *regs)
 {
 	unsigned char asi;
 	u32 insn;
@@ -2031,7 +2032,7 @@ static void sun4v_log_error(struct pt_re
 /* Handle memory corruption detected error which is vectored in
  * through resumable error trap.
  */
-void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
+static void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
 {
 	if (notify_die(DIE_TRAP, "MCD error", regs, 0, 0x34,
 		       SIGSEGV) == NOTIFY_STOP)
@@ -2149,7 +2150,7 @@ static unsigned long sun4v_get_vaddr(str
 /* Attempt to handle non-resumable errors generated from userspace.
  * Returns true if the signal was handled, false otherwise.
  */
-bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
+static bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
 				  struct sun4v_error_entry *ent) {
 
 	unsigned int attrs = ent->err_attrs;
--- a/arch/sparc/mm/init_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/mm/init_64.c
@@ -2641,10 +2641,12 @@ int __meminit vmemmap_populate(unsigned
 	return 0;
 }
 
+#ifdef CONFIG_MEMORY_HOTPLUG
 void vmemmap_free(unsigned long start, unsigned long end,
 		struct vmem_altmap *altmap)
 {
 }
+#endif
 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
 
 /* These are actually filled in at boot time by sun4{u,v}_pgprot_init() */
--- a/arch/sparc/vdso/vma.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/vdso/vma.c
@@ -243,7 +243,7 @@ static int stick_patch(const struct vdso
  * Allocate pages for the vdso and vvar, and copy in the vdso text from the
  * kernel image.
  */
-int __init init_vdso_image(const struct vdso_image *image,
+static int __init init_vdso_image(const struct vdso_image *image,
 			   struct vm_special_mapping *vdso_mapping, bool elf64)
 {
 	int cnpages = (image->size) / PAGE_SIZE;
--- a/arch/sparc/kernel/setup_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/setup_64.c
@@ -599,7 +599,7 @@ static void __init init_sparc64_elf_hwca
 		pause_patch();
 }
 
-void __init alloc_irqstack_bootmem(void)
+static void __init alloc_irqstack_bootmem(void)
 {
 	unsigned int i, node;
 
--- a/arch/sparc/kernel/time_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/time_64.c
@@ -35,6 +35,8 @@
 #include <linux/platform_device.h>
 #include <linux/ftrace.h>
 
+#include <linux/sched/clock.h>
+
 #include <asm/oplib.h>
 #include <asm/timer.h>
 #include <asm/irq.h>
--- a/arch/sparc/power/hibernate.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/power/hibernate.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/suspend.h>
 
 #include <asm/hibernate.h>
 #include <asm/visasm.h>
--- a/arch/sparc/kernel/adi_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/adi_64.c
@@ -121,7 +121,7 @@ adi_not_found:
 		mdesc_release(hp);
 }
 
-tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
+static tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
 				   struct vm_area_struct *vma,
 				   unsigned long addr)
 {
@@ -153,7 +153,7 @@ tag_storage_desc_t *find_tag_store(struc
 	return tag_desc;
 }
 
-tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
+static tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
 				    struct vm_area_struct *vma,
 				    unsigned long addr)
 {
@@ -296,7 +296,7 @@ out:
 	return tag_desc;
 }
 
-void del_tag_store(tag_storage_desc_t *tag_desc, struct mm_struct *mm)
+static void del_tag_store(tag_storage_desc_t *tag_desc, struct mm_struct *mm)
 {
 	unsigned long flags;
 	unsigned char *tags = NULL;
--- /dev/null
+++ a/arch/sparc/include/asm/irq_work.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_SPARC_IRQ_WORK_H
+#define __ASM_SPARC_IRQ_WORK_H
+
+#include <asm-generic/irq_work.h>
+
+extern void arch_irq_work_raise(void);
+
+#endif /* __ASM_SPARC_IRQ_WORK_H */
--- a/arch/sparc/include/asm/floppy_64.h~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/include/asm/floppy_64.h
@@ -197,6 +197,7 @@ static void sun_fd_enable_dma(void)
 	pdma_areasize = pdma_size;
 }
 
+irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie);
 irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie)
 {
 	if (likely(doing_pdma)) {
@@ -434,7 +435,8 @@ static int sun_pci_fd_eject(int drive)
 	return -EINVAL;
 }
 
-void sun_pci_fd_dma_callback(struct ebus_dma_info *p, int event, void *cookie)
+static void
+sun_pci_fd_dma_callback(struct ebus_dma_info *p, int event, void *cookie)
 {
 	floppy_interrupt(0, NULL);
 }
--- a/arch/sparc/prom/init_64.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/prom/init_64.c
@@ -27,8 +27,6 @@ phandle prom_chosen_node;
  * It gets passed the pointer to the PROM vector.
  */
 
-extern void prom_cif_init(void *);
-
 void __init prom_init(void *cif_handler)
 {
 	phandle node;
--- a/arch/sparc/prom/p1275.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/prom/p1275.c
@@ -49,7 +49,7 @@ void p1275_cmd_direct(unsigned long *arg
 	local_irq_restore(flags);
 }
 
-void prom_cif_init(void *cif_handler, void *cif_stack)
+void prom_cif_init(void *cif_handler)
 {
 	p1275buf.prom_cif_handler = (void (*)(long *))cif_handler;
 }
--- a/arch/sparc/include/asm/openprom.h~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/include/asm/openprom.h
@@ -275,6 +275,8 @@ struct linux_prom_pci_intmask {
 	unsigned int interrupt;
 };
 
+extern void prom_cif_init(void *cif_handler);
+
 #endif /* !(__ASSEMBLY__) */
 
 #endif /* !(__SPARC_OPENPROM_H) */
--- a/arch/sparc/kernel/pci_sun4v.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/pci_sun4v.c
@@ -256,7 +256,7 @@ range_alloc_fail:
 	return NULL;
 }
 
-unsigned long dma_4v_iotsb_bind(unsigned long devhandle,
+static unsigned long dma_4v_iotsb_bind(unsigned long devhandle,
 				unsigned long iotsb_num,
 				struct pci_bus *bus_dev)
 {
--- a/arch/sparc/kernel/uprobes.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/arch/sparc/kernel/uprobes.c
@@ -234,6 +234,7 @@ int arch_uprobe_post_xol(struct arch_upr
 /* Handler for uprobe traps.  This is called from the traps table and
  * triggers the proper die notification.
  */
+void uprobe_trap(struct pt_regs *regs, unsigned long trap_level);
 asmlinkage void uprobe_trap(struct pt_regs *regs,
 			    unsigned long trap_level)
 {
--- a/drivers/sbus/char/bbc_i2c.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/drivers/sbus/char/bbc_i2c.c
@@ -358,9 +358,6 @@ fail:
 	return NULL;
 }
 
-extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
-extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
-
 static int bbc_i2c_probe(struct platform_device *op)
 {
 	struct bbc_i2c_bus *bp;
--- a/drivers/sbus/char/bbc_i2c.h~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/drivers/sbus/char/bbc_i2c.h
@@ -82,4 +82,7 @@ extern int bbc_i2c_readb(struct bbc_i2c_
 extern int bbc_i2c_write_buf(struct bbc_i2c_client *, char *buf, int len, int off);
 extern int bbc_i2c_read_buf(struct bbc_i2c_client *, char *buf, int len, int off);
 
+extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
+extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
+
 #endif /* _BBC_I2C_H */
--- a/drivers/mtd/maps/sun_uflash.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
+++ a/drivers/mtd/maps/sun_uflash.c
@@ -47,7 +47,7 @@ struct map_info uflash_map_templ = {
 	.bankwidth =	UFLASH_BUSWIDTH,
 };
 
-int uflash_devinit(struct platform_device *op, struct device_node *dp)
+static int uflash_devinit(struct platform_device *op, struct device_node *dp)
 {
 	struct uflash_dev *up;
  

Patch

diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 0984bb6f0f17..1ce4d5028c86 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -5,7 +5,7 @@ 
 #
 
 asflags-y := -ansi
-ccflags-y := -Werror
+#ccflags-y := -Werror
 
 # Undefine sparc when processing vmlinux.lds - it is used
 # And teach CPP we are doing $(BITS) builds (for this case)
diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile
index 871354aa3c00..a199484e131f 100644
--- a/arch/sparc/mm/Makefile
+++ b/arch/sparc/mm/Makefile
@@ -3,7 +3,7 @@ 
 #
 
 asflags-y := -ansi
-ccflags-y := -Werror
+#ccflags-y := -Werror
 
 obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o
 obj-y                   += fault_$(BITS).o