public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH v2 00/52] m68k: W=1 fixes
@ 2023-09-13 14:07 Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 01/52] m68k: kernel: Add missing asmlinkage to do_notify_resume() Geert Uytterhoeven
                   ` (51 more replies)
  0 siblings, 52 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

	Hi all,

This patch series addresses the remaining (after [1]) warnings seen when
building arch/m68k/ with W=1.  Perhaps surprisingly, this work has
identified and fixes a genuine bug in the Sun-3 TLB handling (see [PATCH
39/52]).

Most of the patches in these series are fairly trivial changes with a
very low risk of introducing any regressions.  For the less trivial
patches, I did look at the assembler output before and after.  As Arnd
is working actively on enabling W=1 rather sooner than later, and if no
one objects, I'm queueing these as fixes for v6.6.

Changes compared to v1[2]:
  - Rebase against v6.6-rc1,
  - Add Acked-by,
  - Include "process.h" instead of <process.h>, to fix in-tree builds,
  - Drop prefix from compiler output,
  - Remove volatile and dedup casts, as suggested by Finn.

Note that this series does not address warnings on Coldfire or MMU-less
systems, but Greg is already taking care of those.

Thanks for your comments!

[1] "[PATCH 0/6] m68k: math-emu: Miscellaneous esthetical improvements"
    https://lore.kernel.org/r/cover.1692283195.git.geert@linux-m68k.org
[2] "[PATCH 00/52] m68k: W=1 fixes"
    https://lore.kernel.org/r/cover.1694093327.git.geert@linux-m68k.org/

Geert Uytterhoeven (52):
  m68k: kernel: Add missing asmlinkage to do_notify_resume()
  m68k: kernel: Include <linux/cpu.h> for trap_init()
  m68k: kernel: Make bad_super_trap() static
  m68k: kernel: Add and use <asm/syscalls.h>
  m68k: kernel: Add and use "ints.h"
  m68k: kernel: Add and use "process.h"
  m68k: kernel: Add and use "ptrace.h"
  m68k: kernel: Add and use "signal.h"
  m68k: kernel: Add and use "traps.h"
  m68k: kernel: Add and use "vectors.h"
  m68k: mm: Include <asm/hwtest.h> for hwreg_()
  m68k: mm: Move paging_init() to common <asm/pgtable.h>
  m68k: mm: Add and use "fault.h"
  m68k: emu: Remove unused vsnprintf() return value in nfprint()
  m68k: emu: Mark version[] __maybe_unused
  m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE()
  m68k: amiga: Add and use "amiga.h"
  m68k: atari: Document data parameter of stdma_try_lock()
  m68k: atari: Make ikbd_reset() static
  m68k: atari: Make atari_platform_init() static
  m68k: atari: Make atari_stram_map_pages() static
  m68k: atari: Add and use "atari.h"
  m68k: apollo: Remove unused debug console functions
  m68k: apollo: Make local reset, serial, and irq functions static
  m68k: apollo: Replace set but not used variable by READ_ONCE()
  m68k: apollo: Add and use "apollo.h"
  m68k: bvme6000: Make bvme6000_abort_int() static
  m68k: hp300: Include "time.h" for hp300_sched_init()
  m68k: mac: Remove unused sine_data[]
  m68k: mac: Remove unused yday in unmktime()
  m68k: mac: Make mac_platform_init() static
  m68k: mac: Add and use "mac.h"
  m68k: mvme147: Make mvme147_init_IRQ() static
  m68k: mvme16x: Remove unused sink in mvme16x_cons_write()
  m68k: mvme16x: Add and use "mvme16x.h"
  m68k: q40: Add and use "q40.h"
  m68k: sun3/3x: Include <asm/config.h> for config_sun3*()
  m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h>
  m68k: sun3: Fix context restore in flush_tlb_range()
  m68k: sun3: Fix signature of sun3_get_model()
  m68k: sun3: Add missing asmlinkage to sun3_init()
  m68k: sun3: Remove unused orig_baddr in free_baddr()
  m68k: sun3: Remove unused start_page in sun3_bootmem_alloc()
  m68k: sun3: Remove unused vsprintf() return value in prom_printf()
  m68k: sun3: Annotate prom_printf() with __printf()
  m68k: sun3: Make print_pte() static
  m68k: sun3: Make sun3_platform_init() static
  m68k: sun3x: Fix signature of sun3_leds()
  m68k: sun3x: Do not mark dvma_map_iommu() inline
  m68k: sun3x: Make sun3x_halt() static
  m68k: sun3x: Make dvma_print() static
  m68k: sun3/3x: Add and use "sun3.h"

 arch/m68k/amiga/amiga.h            |  5 ++++
 arch/m68k/amiga/amisound.c         |  2 ++
 arch/m68k/amiga/config.c           |  4 +--
 arch/m68k/amiga/pcmcia.c           |  3 +-
 arch/m68k/apollo/apollo.h          |  4 +++
 arch/m68k/apollo/config.c          | 45 ++++++------------------------
 arch/m68k/apollo/dn_ints.c         |  8 ++++--
 arch/m68k/atari/ataints.c          |  3 +-
 arch/m68k/atari/atakeyb.c          |  2 +-
 arch/m68k/atari/atari.h            | 15 ++++++++++
 arch/m68k/atari/atasound.c         |  1 +
 arch/m68k/atari/config.c           | 13 ++-------
 arch/m68k/atari/stdma.c            |  1 +
 arch/m68k/atari/stram.c            |  2 +-
 arch/m68k/atari/time.c             |  2 ++
 arch/m68k/bvme6000/config.c        |  2 +-
 arch/m68k/emu/natfeat.c            |  3 +-
 arch/m68k/emu/nfeth.c              |  2 +-
 arch/m68k/hp300/time.c             |  2 ++
 arch/m68k/include/asm/dvma.h       |  8 +++++-
 arch/m68k/include/asm/oplib.h      |  4 ++-
 arch/m68k/include/asm/pgtable.h    |  9 ++++++
 arch/m68k/include/asm/pgtable_no.h |  1 -
 arch/m68k/include/asm/syscalls.h   | 20 +++++++++++++
 arch/m68k/include/asm/tlbflush.h   |  1 +
 arch/m68k/kernel/early_printk.c    |  4 +--
 arch/m68k/kernel/ints.c            |  2 ++
 arch/m68k/kernel/ints.h            |  7 +++++
 arch/m68k/kernel/process.c         |  1 +
 arch/m68k/kernel/process.h         |  8 ++++++
 arch/m68k/kernel/ptrace.c          |  2 ++
 arch/m68k/kernel/ptrace.h          |  6 ++++
 arch/m68k/kernel/setup_mm.c        |  2 --
 arch/m68k/kernel/signal.c          |  4 ++-
 arch/m68k/kernel/signal.h          |  7 +++++
 arch/m68k/kernel/sys_m68k.c        |  4 +--
 arch/m68k/kernel/traps.c           | 11 ++++----
 arch/m68k/kernel/traps.h           | 10 +++++++
 arch/m68k/kernel/vectors.c         |  3 ++
 arch/m68k/kernel/vectors.h         |  3 ++
 arch/m68k/mac/baboon.c             |  2 ++
 arch/m68k/mac/config.c             | 14 ++--------
 arch/m68k/mac/iop.c                |  2 ++
 arch/m68k/mac/mac.h                | 25 +++++++++++++++++
 arch/m68k/mac/macboing.c           | 11 ++------
 arch/m68k/mac/misc.c               |  5 ++--
 arch/m68k/mac/oss.c                |  2 ++
 arch/m68k/mac/psc.c                |  2 ++
 arch/m68k/mac/via.c                |  2 ++
 arch/m68k/mm/fault.c               |  2 ++
 arch/m68k/mm/fault.h               |  7 +++++
 arch/m68k/mm/hwtest.c              |  2 ++
 arch/m68k/mm/sun3kmap.c            |  6 ++--
 arch/m68k/mm/sun3mmu.c             |  2 +-
 arch/m68k/mvme147/config.c         |  2 +-
 arch/m68k/mvme16x/config.c         |  5 ++--
 arch/m68k/mvme16x/mvme16x.h        |  6 ++++
 arch/m68k/q40/config.c             |  6 ++--
 arch/m68k/q40/q40.h                |  6 ++++
 arch/m68k/q40/q40ints.c            |  2 ++
 arch/m68k/sun3/config.c            | 13 ++++-----
 arch/m68k/sun3/idprom.c            |  4 ++-
 arch/m68k/sun3/intersil.c          |  1 +
 arch/m68k/sun3/leds.c              |  2 ++
 arch/m68k/sun3/mmu_emu.c           |  3 +-
 arch/m68k/sun3/prom/printf.c       |  5 ++--
 arch/m68k/sun3/sun3.h              | 22 +++++++++++++++
 arch/m68k/sun3/sun3dvma.c          | 17 -----------
 arch/m68k/sun3/sun3ints.c          |  2 +-
 arch/m68k/sun3x/config.c           |  6 ++--
 arch/m68k/sun3x/dvma.c             |  5 ++--
 arch/m68k/sun3x/prom.c             |  2 +-
 72 files changed, 281 insertions(+), 148 deletions(-)
 create mode 100644 arch/m68k/amiga/amiga.h
 create mode 100644 arch/m68k/apollo/apollo.h
 create mode 100644 arch/m68k/atari/atari.h
 create mode 100644 arch/m68k/include/asm/syscalls.h
 create mode 100644 arch/m68k/kernel/ints.h
 create mode 100644 arch/m68k/kernel/process.h
 create mode 100644 arch/m68k/kernel/ptrace.h
 create mode 100644 arch/m68k/kernel/signal.h
 create mode 100644 arch/m68k/kernel/traps.h
 create mode 100644 arch/m68k/kernel/vectors.h
 create mode 100644 arch/m68k/mac/mac.h
 create mode 100644 arch/m68k/mm/fault.h
 create mode 100644 arch/m68k/mvme16x/mvme16x.h
 create mode 100644 arch/m68k/q40/q40.h
 create mode 100644 arch/m68k/sun3/sun3.h

-- 
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 01/52] m68k: kernel: Add missing asmlinkage to do_notify_resume()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 02/52] m68k: kernel: Include <linux/cpu.h> for trap_init() Geert Uytterhoeven
                   ` (50 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

do_notify_resume() is called from assembly code, so it should be marked
asmlinkage for documentation purposes.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index ba468b5f3f0b65bd..459c5ff69fcfa126 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -1109,7 +1109,7 @@ static void do_signal(struct pt_regs *regs)
 	restore_saved_sigmask();
 }
 
-void do_notify_resume(struct pt_regs *regs)
+asmlinkage void do_notify_resume(struct pt_regs *regs)
 {
 	if (test_thread_flag(TIF_NOTIFY_SIGNAL) ||
 	    test_thread_flag(TIF_SIGPENDING))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 02/52] m68k: kernel: Include <linux/cpu.h> for trap_init()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 01/52] m68k: kernel: Add missing asmlinkage to do_notify_resume() Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 03/52] m68k: kernel: Make bad_super_trap() static Geert Uytterhoeven
                   ` (49 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/vectors.c:74:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes]
       74 | void __init trap_init (void)
	  |             ^~~~~~~~~

Fix this by including <linux/cpu.h>.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/vectors.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c
index 322c977bb9ecfbee..68762fc1dc97b4e1 100644
--- a/arch/m68k/kernel/vectors.c
+++ b/arch/m68k/kernel/vectors.c
@@ -17,6 +17,7 @@
 /*
  * Sets up all exception vectors
  */
+#include <linux/cpu.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/linkage.h>
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 03/52] m68k: kernel: Make bad_super_trap() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 01/52] m68k: kernel: Add missing asmlinkage to do_notify_resume() Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 02/52] m68k: kernel: Include <linux/cpu.h> for trap_init() Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 04/52] m68k: kernel: Add and use <asm/syscalls.h> Geert Uytterhoeven
                   ` (48 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/traps.c:968:6: warning: no previous prototype for ‘bad_super_trap’ [-Wmissing-prototypes]
      968 | void bad_super_trap (struct frame *fp)
	  |      ^~~~~~~~~~~~~~

Fix this by making bad_super_trap() static.
There was never a user outside arch/m68k/kernel/traps.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index a700807c9b6d9999..b3fee39f8f518c6e 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -965,7 +965,7 @@ void show_stack(struct task_struct *task, unsigned long *stack,
  * real 68k parts, but it won't hurt either.
  */
 
-void bad_super_trap (struct frame *fp)
+static void bad_super_trap(struct frame *fp)
 {
 	int vector = (fp->ptregs.vector >> 2) & 0xff;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 04/52] m68k: kernel: Add and use <asm/syscalls.h>
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 03/52] m68k: kernel: Make bad_super_trap() static Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 05/52] m68k: kernel: Add and use "ints.h" Geert Uytterhoeven
                   ` (47 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/sys_m68k.c:40:17: warning: no previous prototype for ‘sys_mmap2’ [-Wmissing-prototypes]
       40 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
	  |                 ^~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:378:1: warning: no previous prototype for ‘sys_cacheflush’ [-Wmissing-prototypes]
      378 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
	  | ^~~~~~~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:463:1: warning: no previous prototype for ‘sys_atomic_cmpxchg_32’ [-Wmissing-prototypes]
      463 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
	  | ^~~~~~~~~~~~~~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:564:16: warning: no previous prototype for ‘sys_getpagesize’ [-Wmissing-prototypes]
      564 | asmlinkage int sys_getpagesize(void)
	  |                ^~~~~~~~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:569:26: warning: no previous prototype for ‘sys_get_thread_area’ [-Wmissing-prototypes]
      569 | asmlinkage unsigned long sys_get_thread_area(void)
	  |                          ^~~~~~~~~~~~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:574:16: warning: no previous prototype for ‘sys_set_thread_area’ [-Wmissing-prototypes]
      574 | asmlinkage int sys_set_thread_area(unsigned long tp)
	  |                ^~~~~~~~~~~~~~~~~~~
    arch/m68k/kernel/sys_m68k.c:580:16: warning: no previous prototype for ‘sys_atomic_barrier’ [-Wmissing-prototypes]
      580 | asmlinkage int sys_atomic_barrier(void)
	  |                ^~~~~~~~~~~~~~~~~~

Fix this by introducing a new header file <asm/syscalls.h> for holding
the prototypes for m68k-specific syscalls, and including the generic
ones.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/include/asm/syscalls.h | 20 ++++++++++++++++++++
 arch/m68k/kernel/sys_m68k.c      |  1 +
 2 files changed, 21 insertions(+)
 create mode 100644 arch/m68k/include/asm/syscalls.h

diff --git a/arch/m68k/include/asm/syscalls.h b/arch/m68k/include/asm/syscalls.h
new file mode 100644
index 0000000000000000..6d814ffa2560105d
--- /dev/null
+++ b/arch/m68k/include/asm/syscalls.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _ASM_M68K_SYSCALLS_H
+#define _ASM_M68K_SYSCALLS_H
+
+#include <linux/compiler_types.h>
+#include <linux/linkage.h>
+
+asmlinkage int sys_cacheflush(unsigned long addr, int scope, int cache,
+			      unsigned long len);
+asmlinkage int sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3,
+				     int d4, int d5, unsigned long __user *mem);
+asmlinkage int sys_getpagesize(void);
+asmlinkage unsigned long sys_get_thread_area(void);
+asmlinkage int sys_set_thread_area(unsigned long tp);
+asmlinkage int sys_atomic_barrier(void);
+
+#include <asm-generic/syscalls.h>
+
+#endif	/* _ASM_M68K_SYSCALLS_H */
+
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index c586034d2a7ac85d..14055d676161d725 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -27,6 +27,7 @@
 #include <asm/cachectl.h>
 #include <asm/traps.h>
 #include <asm/page.h>
+#include <asm/syscalls.h>
 #include <asm/unistd.h>
 #include <asm/cacheflush.h>
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 05/52] m68k: kernel: Add and use "ints.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 04/52] m68k: kernel: Add and use <asm/syscalls.h> Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 06/52] m68k: kernel: Add and use "process.h" Geert Uytterhoeven
                   ` (46 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/ints.c:165:17: warning: no previous prototype for ‘handle_badint’ [-Wmissing-prototypes]
      165 | asmlinkage void handle_badint(struct pt_regs *regs)
	  |                 ^~~~~~~~~~~~~

Fix this by introducing a new header file "ints.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/ints.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/ints.c | 2 ++
 arch/m68k/kernel/ints.h | 7 +++++++
 2 files changed, 9 insertions(+)
 create mode 100644 arch/m68k/kernel/ints.h

diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 5b8d66fbf3832a2c..cf2b13488476c8c6 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -26,6 +26,8 @@
 #include <asm/q40ints.h>
 #endif
 
+#include "ints.h"
+
 extern u32 auto_irqhandler_fixup[];
 extern u16 user_irqvec_fixup[];
 
diff --git a/arch/m68k/kernel/ints.h b/arch/m68k/kernel/ints.h
new file mode 100644
index 0000000000000000..ecac6011c1a45489
--- /dev/null
+++ b/arch/m68k/kernel/ints.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <linux/linkage.h>
+
+struct pt_regs;
+
+asmlinkage void handle_badint(struct pt_regs *regs);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 06/52] m68k: kernel: Add and use "process.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 05/52] m68k: kernel: Add and use "ints.h" Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 07/52] m68k: kernel: Add and use "ptrace.h" Geert Uytterhoeven
                   ` (45 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/process.c:115:16: warning: no previous prototype for ‘m68k_clone’ [-Wmissing-prototypes]
      115 | asmlinkage int m68k_clone(struct pt_regs *regs)
	  |                ^~~~~~~~~~
    arch/m68k/kernel/process.c:136:16: warning: no previous prototype for ‘m68k_clone3’ [-Wmissing-prototypes]
      136 | asmlinkage int m68k_clone3(struct pt_regs *regs)
	  |                ^~~~~~~~~~~

Fix this by introducing a new header file "process.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/process.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by,
  - Include "process.h" instead of <process.h>, to fix in-tree builds.
---
 arch/m68k/kernel/process.c | 1 +
 arch/m68k/kernel/process.h | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 100644 arch/m68k/kernel/process.h

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index e06ce147c0b7fcf2..2584e94e213468f1 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -38,6 +38,7 @@
 #include <asm/machdep.h>
 #include <asm/setup.h>
 
+#include "process.h"
 
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
diff --git a/arch/m68k/kernel/process.h b/arch/m68k/kernel/process.h
new file mode 100644
index 0000000000000000..d31745f2e64bebab
--- /dev/null
+++ b/arch/m68k/kernel/process.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/linkage.h>
+
+struct pt_regs;
+
+asmlinkage int m68k_clone(struct pt_regs *regs);
+asmlinkage int m68k_clone3(struct pt_regs *regs);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 07/52] m68k: kernel: Add and use "ptrace.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (5 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 06/52] m68k: kernel: Add and use "process.h" Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 08/52] m68k: kernel: Add and use "signal.h" Geert Uytterhoeven
                   ` (44 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/ptrace.c:275:16: warning: no previous prototype for ‘syscall_trace_enter’ [-Wmissing-prototypes]
      275 | asmlinkage int syscall_trace_enter(void)
	  |                ^~~~~~~~~~~~~~~~~~~
    arch/m68k/kernel/ptrace.c:288:17: warning: no previous prototype for ‘syscall_trace_leave’ [-Wmissing-prototypes]
      288 | asmlinkage void syscall_trace_leave(void)
	  |                 ^~~~~~~~~~~~~~~~~~~

Fix this by introducing a new header file "ptrace.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/ptrace.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/ptrace.c | 2 ++
 arch/m68k/kernel/ptrace.h | 6 ++++++
 2 files changed, 8 insertions(+)
 create mode 100644 arch/m68k/kernel/ptrace.h

diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index cd0172d294306d10..c20d590e429703e9 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -26,6 +26,8 @@
 #include <asm/page.h>
 #include <asm/processor.h>
 
+#include "ptrace.h"
+
 /*
  * does not yet catch signals sent when the child dies.
  * in exit.c or in signal.c.
diff --git a/arch/m68k/kernel/ptrace.h b/arch/m68k/kernel/ptrace.h
new file mode 100644
index 0000000000000000..77018037f10f9781
--- /dev/null
+++ b/arch/m68k/kernel/ptrace.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <linux/linkage.h>
+
+asmlinkage int syscall_trace_enter(void);
+asmlinkage void syscall_trace_leave(void);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 08/52] m68k: kernel: Add and use "signal.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (6 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 07/52] m68k: kernel: Add and use "ptrace.h" Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:07 ` [PATCH v2 09/52] m68k: kernel: Add and use "traps.h" Geert Uytterhoeven
                   ` (43 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/signal.c:756:18: warning: no previous prototype for ‘do_sigreturn’ [-Wmissing-prototypes]
      756 | asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
	  |                  ^~~~~~~~~~~~
    arch/m68k/kernel/signal.c:783:18: warning: no previous prototype for ‘do_rt_sigreturn’ [-Wmissing-prototypes]
      783 | asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw)
	  |                  ^~~~~~~~~~~~~~~
    arch/m68k/kernel/signal.c:1112:17: warning: no previous prototype for ‘do_notify_resume’ [-Wmissing-prototypes]
     1112 | asmlinkage void do_notify_resume(struct pt_regs *regs)
	  |                 ^~~~~~~~~~~~~~~~

Fix this by introducing a new header file "signal.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/signal.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/signal.c | 2 ++
 arch/m68k/kernel/signal.h | 7 +++++++
 2 files changed, 9 insertions(+)
 create mode 100644 arch/m68k/kernel/signal.h

diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 459c5ff69fcfa126..e628b859ef21beaf 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -51,6 +51,8 @@
 #include <asm/ucontext.h>
 #include <asm/cacheflush.h>
 
+#include "signal.h"
+
 #ifdef CONFIG_MMU
 
 /*
diff --git a/arch/m68k/kernel/signal.h b/arch/m68k/kernel/signal.h
new file mode 100644
index 0000000000000000..498d84f828202541
--- /dev/null
+++ b/arch/m68k/kernel/signal.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <linux/linkage.h>
+
+asmlinkage void do_notify_resume(struct pt_regs *regs);
+asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw);
+asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 09/52] m68k: kernel: Add and use "traps.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (7 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 08/52] m68k: kernel: Add and use "signal.h" Geert Uytterhoeven
@ 2023-09-13 14:07 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 10/52] m68k: kernel: Add and use "vectors.h" Geert Uytterhoeven
                   ` (42 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:07 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/traps.c:754:17: warning: no previous prototype for ‘buserr_c’ [-Wmissing-prototypes]
      754 | asmlinkage void buserr_c(struct frame *fp)
	  |                 ^~~~~~~~
    arch/m68k/kernel/traps.c:1140:17: warning: no previous prototype for ‘set_esp0’ [-Wmissing-prototypes]
     1140 | asmlinkage void set_esp0(unsigned long ssp)
	  |                 ^~~~~~~~
    arch/m68k/kernel/traps.c:1155:17: warning: no previous prototype for ‘fpemu_signal’ [-Wmissing-prototypes]
     1155 | asmlinkage void fpemu_signal(int signal, int code, void *addr)
	  |                 ^~~~~~~~~~~~
    arch/m68k/kernel/traps.c:1149:17: warning: no previous prototype for ‘fpsp040_die’ [-Wmissing-prototypes]
     1149 | asmlinkage void fpsp040_die(void)
	  |                 ^~~~~~~~~~~

Fix this by introducing a new header file "traps.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/traps.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/traps.c |  2 ++
 arch/m68k/kernel/traps.h | 10 ++++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 arch/m68k/kernel/traps.h

diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index b3fee39f8f518c6e..d408334712f7118b 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -41,6 +41,8 @@
 #include <asm/siginfo.h>
 #include <asm/tlbflush.h>
 
+#include "traps.h"
+
 static const char *vec_names[] = {
 	[VEC_RESETSP]	= "RESET SP",
 	[VEC_RESETPC]	= "RESET PC",
diff --git a/arch/m68k/kernel/traps.h b/arch/m68k/kernel/traps.h
new file mode 100644
index 0000000000000000..6414b4a0e5585671
--- /dev/null
+++ b/arch/m68k/kernel/traps.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <linux/linkage.h>
+
+struct frame;
+
+asmlinkage void buserr_c(struct frame *fp);
+asmlinkage void fpemu_signal(int signal, int code, void *addr);
+asmlinkage void fpsp040_die(void);
+asmlinkage void set_esp0(unsigned long ssp);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 10/52] m68k: kernel: Add and use "vectors.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (8 preceding siblings ...)
  2023-09-13 14:07 ` [PATCH v2 09/52] m68k: kernel: Add and use "traps.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 11/52] m68k: mm: Include <asm/hwtest.h> for hwreg_() Geert Uytterhoeven
                   ` (41 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/kernel/vectors.c:52:13: warning: no previous prototype for ‘base_trap_init’ [-Wmissing-prototypes]
       52 | void __init base_trap_init(void)
	  |             ^~~~~~~~~~~~~~

Fix this by introducing a new header file "vectors.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/vectors.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/vectors.c | 2 ++
 arch/m68k/kernel/vectors.h | 3 +++
 2 files changed, 5 insertions(+)
 create mode 100644 arch/m68k/kernel/vectors.h

diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c
index 68762fc1dc97b4e1..667e848070f4d3d7 100644
--- a/arch/m68k/kernel/vectors.c
+++ b/arch/m68k/kernel/vectors.c
@@ -28,6 +28,8 @@
 #include <asm/fpu.h>
 #include <asm/traps.h>
 
+#include "vectors.h"
+
 /* assembler routines */
 asmlinkage void system_call(void);
 asmlinkage void buserr(void);
diff --git a/arch/m68k/kernel/vectors.h b/arch/m68k/kernel/vectors.h
new file mode 100644
index 0000000000000000..897330737ec570a5
--- /dev/null
+++ b/arch/m68k/kernel/vectors.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+void base_trap_init(void);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 11/52] m68k: mm: Include <asm/hwtest.h> for hwreg_()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (9 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 10/52] m68k: kernel: Add and use "vectors.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 12/52] m68k: mm: Move paging_init() to common <asm/pgtable.h> Geert Uytterhoeven
                   ` (40 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mm/hwtest.c:29:5: warning: no previous prototype for ‘hwreg_present’ [-Wmissing-prototypes]
       29 | int hwreg_present(volatile void *regp)
	  |     ^~~~~~~~~~~~~
    arch/m68k/mm/hwtest.c:62:5: warning: no previous prototype for ‘hwreg_write’ [-Wmissing-prototypes]
       62 | int hwreg_write(volatile void *regp, unsigned short val)
	  |     ^~~~~~~~~~~

Fix this by including <asm/hwtest.h>.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mm/hwtest.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c
index fe99aa99987e9c38..8ee7a336868868bb 100644
--- a/arch/m68k/mm/hwtest.c
+++ b/arch/m68k/mm/hwtest.c
@@ -26,6 +26,8 @@
 
 #include <linux/module.h>
 
+#include <asm/hwtest.h>
+
 int hwreg_present(volatile void *regp)
 {
 	int ret = 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 12/52] m68k: mm: Move paging_init() to common <asm/pgtable.h>
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (10 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 11/52] m68k: mm: Include <asm/hwtest.h> for hwreg_() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 13/52] m68k: mm: Add and use "fault.h" Geert Uytterhoeven
                   ` (39 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mm/motorola.c:414:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes]
      414 | void __init paging_init(void)
	  |             ^~~~~~~~~~~
    arch/m68k/mm/sun3mmu.c:36:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes]
       36 | void __init paging_init(void)
	  |             ^~~~~~~~~~~

Fix this by consolidating the multiple prototypes into the common
<asm/pgtable.h>.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/include/asm/pgtable.h    | 9 +++++++++
 arch/m68k/include/asm/pgtable_no.h | 1 -
 arch/m68k/kernel/setup_mm.c        | 2 --
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/include/asm/pgtable.h b/arch/m68k/include/asm/pgtable.h
index ad15d655a9bfb3b5..27525c6a12fd0c7f 100644
--- a/arch/m68k/include/asm/pgtable.h
+++ b/arch/m68k/include/asm/pgtable.h
@@ -1,6 +1,15 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __M68K_PGTABLE_H
+#define __M68K_PGTABLE_H
+
 #ifdef __uClinux__
 #include <asm/pgtable_no.h>
 #else
 #include <asm/pgtable_mm.h>
 #endif
+
+#ifndef __ASSEMBLY__
+extern void paging_init(void);
+#endif
+
+#endif /* __M68K_PGTABLE_H */
diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h
index fc044df52b96c149..1a86c15b9008f03d 100644
--- a/arch/m68k/include/asm/pgtable_no.h
+++ b/arch/m68k/include/asm/pgtable_no.h
@@ -28,7 +28,6 @@
 #define PAGE_READONLY	__pgprot(0)
 #define PAGE_KERNEL	__pgprot(0)
 
-extern void paging_init(void);
 #define swapper_pg_dir ((pgd_t *) 0)
 
 /*
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 6f1ae01f322cf231..10310b04f77d8d79 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -107,8 +107,6 @@ EXPORT_SYMBOL(isa_sex);
 
 #define MASK_256K 0xfffc0000
 
-extern void paging_init(void);
-
 static void __init m68k_parse_bootinfo(const struct bi_record *record)
 {
 	const struct bi_record *first_record = record;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 13/52] m68k: mm: Add and use "fault.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (11 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 12/52] m68k: mm: Move paging_init() to common <asm/pgtable.h> Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 14/52] m68k: emu: Remove unused vsnprintf() return value in nfprint() Geert Uytterhoeven
                   ` (38 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mm/fault.c:22:5: warning: no previous prototype for ‘send_fault_sig’ [-Wmissing-prototypes]
       22 | int send_fault_sig(struct pt_regs *regs)
	  |     ^~~~~~~~~~~~~~
    arch/m68k/mm/fault.c:68:5: warning: no previous prototype for ‘do_page_fault’ [-Wmissing-prototypes]
       68 | int do_page_fault(struct pt_regs *regs, unsigned long address,
	  |     ^~~~~~~~~~~~~

Fix this by introducing a new header file "fault.h" for holding the
prototypes of functions implemented in arch/m68k/mm/fault.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/sys_m68k.c | 3 +--
 arch/m68k/kernel/traps.c    | 5 +----
 arch/m68k/mm/fault.c        | 2 ++
 arch/m68k/mm/fault.h        | 7 +++++++
 4 files changed, 11 insertions(+), 6 deletions(-)
 create mode 100644 arch/m68k/mm/fault.h

diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 14055d676161d725..1af5e60824676bf3 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -35,8 +35,7 @@
 
 #include <asm/tlb.h>
 
-asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
-			     unsigned long error_code);
+#include "../mm/fault.h"
 
 asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
 	unsigned long prot, unsigned long flags,
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index d408334712f7118b..129c89349e1a40aa 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -42,6 +42,7 @@
 #include <asm/tlbflush.h>
 
 #include "traps.h"
+#include "../mm/fault.h"
 
 static const char *vec_names[] = {
 	[VEC_RESETSP]	= "RESET SP",
@@ -126,10 +127,6 @@ static const char *space_names[] = {
 };
 
 void die_if_kernel(char *,struct pt_regs *,int);
-asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
-                             unsigned long error_code);
-int send_fault_sig(struct pt_regs *regs);
-
 asmlinkage void trap_c(struct frame *fp);
 
 #if defined (CONFIG_M68060)
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index c290c5c0cfb93a81..fa3c5f38d9894c08 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -17,6 +17,8 @@
 #include <asm/setup.h>
 #include <asm/traps.h>
 
+#include "fault.h"
+
 extern void die_if_kernel(char *, struct pt_regs *, long);
 
 int send_fault_sig(struct pt_regs *regs)
diff --git a/arch/m68k/mm/fault.h b/arch/m68k/mm/fault.h
new file mode 100644
index 0000000000000000..dab14ef7d4a171d5
--- /dev/null
+++ b/arch/m68k/mm/fault.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+struct pt_regs;
+
+int do_page_fault(struct pt_regs *regs, unsigned long address,
+		  unsigned long error_code);
+int send_fault_sig(struct pt_regs *regs);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 14/52] m68k: emu: Remove unused vsnprintf() return value in nfprint()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (12 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 13/52] m68k: mm: Add and use "fault.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 15/52] m68k: emu: Mark version[] __maybe_unused Geert Uytterhoeven
                   ` (37 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/emu/natfeat.c: In function ‘nfprint’:
    arch/m68k/emu/natfeat.c:59:13: warning: variable ‘n’ set but not used [-Wunused-but-set-variable]
       59 |         int n;
	  |             ^

As the return value of vsnprintf() is unused, and serves no practical
purpose here, fix this by removing the variable.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/emu/natfeat.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/emu/natfeat.c b/arch/m68k/emu/natfeat.c
index b19dc00026d9953b..344637539438d682 100644
--- a/arch/m68k/emu/natfeat.c
+++ b/arch/m68k/emu/natfeat.c
@@ -56,10 +56,9 @@ void nfprint(const char *fmt, ...)
 {
 	static char buf[256];
 	va_list ap;
-	int n;
 
 	va_start(ap, fmt);
-	n = vsnprintf(buf, 256, fmt, ap);
+	vsnprintf(buf, 256, fmt, ap);
 	nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf));
 	va_end(ap);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 15/52] m68k: emu: Mark version[] __maybe_unused
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (13 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 14/52] m68k: emu: Remove unused vsnprintf() return value in nfprint() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 16/52] m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
                   ` (36 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but not used [-Wunused-const-variable=]
       42 | static const char version[] =
	  |                   ^~~~~~~

Fix this while obeying the wishes of the original copyright holders by
marking version[] with __maybe_unused.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by,
  - Drop prefix from compiler output.
---
 arch/m68k/emu/nfeth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index 1a5d1e8eb4c80839..26e68813f35144f8 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -39,7 +39,7 @@ enum {
 #define MAX_UNIT	8
 
 /* These identify the driver base version and may not be removed. */
-static const char version[] =
+static const char version[] __maybe_unused =
 	KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
 	" S.Opichal, M.Jurik, P.Stehlik\n"
 	KERN_INFO " http://aranym.org/\n";
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 16/52] m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (14 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 15/52] m68k: emu: Mark version[] __maybe_unused Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 17/52] m68k: amiga: Add and use "amiga.h" Geert Uytterhoeven
                   ` (35 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/amiga/pcmcia.c: In function ‘pcmcia_reset’:
    arch/m68k/amiga/pcmcia.c:29:23: warning: variable ‘b’ set but not used [-Wunused-but-set-variable]
       29 |         unsigned char b;
	  |                       ^

Fix this by using READ_ONCE(), and removing the variable.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/amiga/pcmcia.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/amiga/pcmcia.c b/arch/m68k/amiga/pcmcia.c
index 7106f0c3639bc105..63cce6b590df4dcb 100644
--- a/arch/m68k/amiga/pcmcia.c
+++ b/arch/m68k/amiga/pcmcia.c
@@ -26,11 +26,10 @@ static unsigned char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS;
 void pcmcia_reset(void)
 {
 	unsigned long reset_start_time = jiffies;
-	unsigned char b;
 
 	gayle_reset = 0x00;
 	while (time_before(jiffies, reset_start_time + 1*HZ/100));
-	b = gayle_reset;
+	READ_ONCE(gayle_reset);
 }
 EXPORT_SYMBOL(pcmcia_reset);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 17/52] m68k: amiga: Add and use "amiga.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (15 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 16/52] m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 18/52] m68k: atari: Document data parameter of stdma_try_lock() Geert Uytterhoeven
                   ` (34 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/amiga/amisound.c:48:13: warning: no previous prototype for ‘amiga_init_sound’ [-Wmissing-prototypes]
       48 | void __init amiga_init_sound(void)
	  |             ^~~~~~~~~~~~~~~~
    arch/m68k/amiga/amisound.c:71:6: warning: no previous prototype for ‘amiga_mksound’ [-Wmissing-prototypes]
       71 | void amiga_mksound( unsigned int hz, unsigned int ticks )
	  |      ^~~~~~~~~~~~~

Fix this by introducing a new header file "amiga.h" for holding the
prototypes of functions implemented in arch/m68k/amiga/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/amiga/amiga.h    | 5 +++++
 arch/m68k/amiga/amisound.c | 2 ++
 arch/m68k/amiga/config.c   | 4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 arch/m68k/amiga/amiga.h

diff --git a/arch/m68k/amiga/amiga.h b/arch/m68k/amiga/amiga.h
new file mode 100644
index 0000000000000000..00392781442cb91a
--- /dev/null
+++ b/arch/m68k/amiga/amiga.h
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* amisound.c */
+void amiga_init_sound(void);
+void amiga_mksound(unsigned int hz, unsigned int ticks);
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index 442bdeee6bd7920c..714fe8ec6afa3364 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -16,6 +16,8 @@
 
 #include <asm/amigahw.h>
 
+#include "amiga.h"
+
 static unsigned short *snd_data;
 static const signed char sine_data[] = {
 	0,  39,  75,  103,  121,  127,  121,  103,  75,  39,
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 3137b45750dfcea7..7791673e547bf795 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -39,6 +39,8 @@
 #include <asm/io.h>
 #include <asm/config.h>
 
+#include "amiga.h"
+
 static unsigned long amiga_model;
 
 unsigned long amiga_eclock;
@@ -96,9 +98,7 @@ static char amiga_model_name[13] = "Amiga ";
 static void amiga_sched_init(void);
 static void amiga_get_model(char *model);
 static void amiga_get_hardware_list(struct seq_file *m);
-extern void amiga_mksound(unsigned int count, unsigned int ticks);
 static void amiga_reset(void);
-extern void amiga_init_sound(void);
 static void amiga_mem_console_write(struct console *co, const char *b,
 				    unsigned int count);
 #ifdef CONFIG_HEARTBEAT
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 18/52] m68k: atari: Document data parameter of stdma_try_lock()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (16 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 17/52] m68k: amiga: Add and use "amiga.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 19/52] m68k: atari: Make ikbd_reset() static Geert Uytterhoeven
                   ` (33 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/atari/stdma.c:69: warning: Function parameter or member 'data' not described in 'stdma_try_lock'

Fix this by documenting the data parameter.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/atari/stdma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c
index ce6818eff75efcdf..155fefff19b0e19d 100644
--- a/arch/m68k/atari/stdma.c
+++ b/arch/m68k/atari/stdma.c
@@ -61,6 +61,7 @@ static irqreturn_t stdma_int (int irq, void *dummy);
 /**
  * stdma_try_lock - attempt to acquire ST DMA interrupt "lock"
  * @handler: interrupt handler to use after acquisition
+ * @data: cookie passed to the interrupt handler function
  *
  * Returns !0 if lock was acquired; otherwise 0.
  */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 19/52] m68k: atari: Make ikbd_reset() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (17 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 18/52] m68k: atari: Document data parameter of stdma_try_lock() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 20/52] m68k: atari: Make atari_platform_init() static Geert Uytterhoeven
                   ` (32 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/atari/atakeyb.c:335:6: warning: no previous prototype for ‘ikbd_reset’ [-Wmissing-prototypes]
      335 | void ikbd_reset(void)
	  |      ^~~~~~~~~~

Fix this by making ikbd_reset() static.
There was never a user outside arch/m68k/atari/atakey.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/atari/atakeyb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index 5e0e682f9c61a60e..49a9a459bdf4ccbd 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -332,7 +332,7 @@ void ikbd_write(const char *str, int len)
 }
 
 /* Reset (without touching the clock) */
-void ikbd_reset(void)
+static void ikbd_reset(void)
 {
 	static const char cmd[2] = { 0x80, 0x01 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 20/52] m68k: atari: Make atari_platform_init() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (18 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 19/52] m68k: atari: Make ikbd_reset() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 21/52] m68k: atari: Make atari_stram_map_pages() static Geert Uytterhoeven
                   ` (31 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/atari/config.c:883:12: warning: no previous prototype for ‘atari_platform_init’ [-Wmissing-prototypes]
      883 | int __init atari_platform_init(void)
	  |            ^~~~~~~~~~~~~~~~~~~

Fix this by making atari_platform_init() static.
There was never a user outside arch/m68k/atari/config.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/atari/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 38a7c05781059840..b4fe4273ad912ebe 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -880,7 +880,7 @@ static const struct resource atari_falconide_rsrc[] __initconst = {
 	DEFINE_RES_MEM(FALCON_IDE_BASE + 0x38, 2),
 };
 
-int __init atari_platform_init(void)
+static int __init atari_platform_init(void)
 {
 	struct platform_device *pdev;
 	int rv = 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 21/52] m68k: atari: Make atari_stram_map_pages() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (19 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 20/52] m68k: atari: Make atari_platform_init() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 22/52] m68k: atari: Add and use "atari.h" Geert Uytterhoeven
                   ` (30 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/atari/stram.c:118:12: warning: no previous prototype for ‘atari_stram_map_pages’ [-Wmissing-prototypes]
      118 | int __init atari_stram_map_pages(void)
	  |            ^~~~~~~~~~~~~~~~~~~~~

Fix this by making atari_stram_map_pages() static.
There was never a user outside arch/m68k/atari/stram.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/atari/stram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index ce79b322a99cbda4..922e53bcb853289d 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -115,7 +115,7 @@ void __init atari_stram_reserve_pages(void *start_mem)
  * This function is called as arch initcall to reserve the pages needed for
  * ST-RAM management, if the kernel does not reside in ST-RAM.
  */
-int __init atari_stram_map_pages(void)
+static int __init atari_stram_map_pages(void)
 {
 	if (!kernel_in_stram) {
 		/*
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 22/52] m68k: atari: Add and use "atari.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (20 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 21/52] m68k: atari: Make atari_stram_map_pages() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 23/52] m68k: apollo: Remove unused debug console functions Geert Uytterhoeven
                   ` (29 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/atari/time.c:59:1: warning: no previous prototype for ‘atari_sched_init’ [-Wmissing-prototypes]
       59 | atari_sched_init(void)
	  | ^~~~~~~~~~~~~~~~
    arch/m68k/atari/time.c:140:5: warning: no previous prototype for ‘atari_mste_hwclk’ [-Wmissing-prototypes]
      140 | int atari_mste_hwclk( int op, struct rtc_time *t )
	  |     ^~~~~~~~~~~~~~~~
    arch/m68k/atari/time.c:199:5: warning: no previous prototype for ‘atari_tt_hwclk’ [-Wmissing-prototypes]
      199 | int atari_tt_hwclk( int op, struct rtc_time *t )
	  |     ^~~~~~~~~~~~~~
    arch/m68k/atari/ataints.c:267:13: warning: no previous prototype for ‘atari_init_IRQ’ [-Wmissing-prototypes]
      267 | void __init atari_init_IRQ(void)
	  |             ^~~~~~~~~~~~~~
    arch/m68k/atari/atasound.c:36:6: warning: no previous prototype for ‘atari_microwire_cmd’ [-Wmissing-prototypes]
       36 | void atari_microwire_cmd (int cmd)
	  |      ^~~~~~~~~~~~~~~~~~~
    arch/m68k/atari/atasound.c:53:6: warning: no previous prototype for ‘atari_mksound’ [-Wmissing-prototypes]
       53 | void atari_mksound (unsigned int hz, unsigned int ticks)
	  |      ^~~~~~~~~~~~~

Fix this by introducing a new header file "atari.h" for holding the
prototypes of functions implemented in arch/m68k/atari/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/atari/ataints.c  |  3 +--
 arch/m68k/atari/atari.h    | 15 +++++++++++++++
 arch/m68k/atari/atasound.c |  1 +
 arch/m68k/atari/config.c   | 11 ++---------
 arch/m68k/atari/time.c     |  2 ++
 5 files changed, 21 insertions(+), 11 deletions(-)
 create mode 100644 arch/m68k/atari/atari.h

diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 56f02ea2c248d844..23256434191c39af 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -52,6 +52,7 @@
 #include <asm/entry.h>
 #include <asm/io.h>
 
+#include "atari.h"
 
 /*
  * Atari interrupt handling scheme:
@@ -81,8 +82,6 @@ __ALIGN_STR "\n\t"
 	"orw	#0x200,%sp@\n\t"	/* set saved ipl to 2 */
 	"rte");
 
-extern void atari_microwire_cmd(int cmd);
-
 static unsigned int atari_irq_startup(struct irq_data *data)
 {
 	unsigned int irq = data->irq;
diff --git a/arch/m68k/atari/atari.h b/arch/m68k/atari/atari.h
new file mode 100644
index 0000000000000000..494a03ddac3d16ae
--- /dev/null
+++ b/arch/m68k/atari/atari.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+struct rtc_time;
+
+/* ataints.c */
+void atari_init_IRQ(void);
+
+/* atasound.c */
+void atari_microwire_cmd(int cmd);
+void atari_mksound(unsigned int hz, unsigned int ticks);
+
+/* time.c */
+void atari_sched_init(void);
+int atari_mste_hwclk(int op, struct rtc_time *t);
+int atari_tt_hwclk(int op, struct rtc_time *t);
diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c
index a8724d998c39fcfa..c38ef0e6078e7260 100644
--- a/arch/m68k/atari/atasound.c
+++ b/arch/m68k/atari/atasound.c
@@ -28,6 +28,7 @@
 #include <asm/irq.h>
 #include <asm/atariints.h>
 
+#include "atari.h"
 
 /*
  * stuff from the old atasound.c
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index b4fe4273ad912ebe..b48a0606a00068b9 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -48,6 +48,8 @@
 #include <asm/io.h>
 #include <asm/config.h>
 
+#include "atari.h"
+
 u_long atari_mch_cookie;
 EXPORT_SYMBOL(atari_mch_cookie);
 
@@ -69,19 +71,10 @@ int atari_rtc_year_offset;
 static void atari_reset(void);
 static void atari_get_model(char *model);
 static void atari_get_hardware_list(struct seq_file *m);
-
-/* atari specific irq functions */
-extern void atari_init_IRQ (void);
-extern void atari_mksound(unsigned int count, unsigned int ticks);
 #ifdef CONFIG_HEARTBEAT
 static void atari_heartbeat(int on);
 #endif
 
-/* atari specific timer functions (in time.c) */
-extern void atari_sched_init(void);
-extern int atari_mste_hwclk (int, struct rtc_time *);
-extern int atari_tt_hwclk (int, struct rtc_time *);
-
 /* ++roman: This is a more elaborate test for an SCC chip, since the plain
  * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
  * board in the Medusa is possible. Also, the addresses where the ST_ESCC
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index 7e44d0e9d0f8a902..3453c6dc6b41d3c9 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -23,6 +23,8 @@
 #include <asm/atariints.h>
 #include <asm/machdep.h>
 
+#include "atari.h"
+
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL_GPL(rtc_lock);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 23/52] m68k: apollo: Remove unused debug console functions
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (21 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 22/52] m68k: atari: Add and use "atari.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 24/52] m68k: apollo: Make local reset, serial, and irq functions static Geert Uytterhoeven
                   ` (28 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/apollo/config.c:111:5: warning: no previous prototype for ‘dn_serial_console_wait_key’ [-Wmissing-prototypes]
      111 | int dn_serial_console_wait_key(struct console *co) {
	  |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/m68k/apollo/config.c:118:6: warning: no previous prototype for ‘dn_serial_console_write’ [-Wmissing-prototypes]
      118 | void dn_serial_console_write (struct console *co, const char *str,unsigned int count)
	  |      ^~~~~~~~~~~~~~~~~~~~~~~
    arch/m68k/apollo/config.c:238:6: warning: no previous prototype for ‘dn_dummy_waitbut’ [-Wmissing-prototypes]
      240 | void dn_dummy_waitbut(void) {
	  |      ^~~~~~~~~~~~~~~~

Fix this by removing these unused functions.
The last user of dn_serial_console_write() was removed in v2.3.41.
The other functions never had any users.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/apollo/config.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 42a8b8e2b664226a..fccbb40772dca6b9 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -4,7 +4,6 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/console.h>
 #include <linux/rtc.h>
 #include <linux/vt_kern.h>
 #include <linux/interrupt.h>
@@ -108,27 +107,6 @@ static void __init dn_setup_model(void)
 
 }
 
-int dn_serial_console_wait_key(struct console *co) {
-
-	while(!(sio01.srb_csrb & 1))
-		barrier();
-	return sio01.rhrb_thrb;
-}
-
-void dn_serial_console_write (struct console *co, const char *str,unsigned int count)
-{
-   while(count--) {
-	if (*str == '\n') {
-	sio01.rhrb_thrb = (unsigned char)'\r';
-	while (!(sio01.srb_csrb & 0x4))
-                ;
-	}
-    sio01.rhrb_thrb = (unsigned char)*str++;
-    while (!(sio01.srb_csrb & 0x4))
-            ;
-  }
-}
-
 void dn_serial_print (const char *str)
 {
     while (*str) {
@@ -237,12 +215,6 @@ void dn_dummy_reset(void) {
 
 }
 
-void dn_dummy_waitbut(void) {
-
-  dn_serial_print("waitbut\n");
-
-}
-
 static void dn_get_model(char *model)
 {
     strcpy(model, "Apollo ");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 24/52] m68k: apollo: Make local reset, serial, and irq functions static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (22 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 23/52] m68k: apollo: Remove unused debug console functions Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
                   ` (27 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/apollo/config.c:132:6: warning: no previous prototype for ‘dn_serial_print’ [-Wmissing-prototypes]
      110 | void dn_serial_print (const char *str)
	  |      ^~~~~~~~~~~~~~~
    arch/m68k/apollo/dn_ints.c:8:14: warning: no previous prototype for ‘apollo_irq_startup’ [-Wmissing-prototypes]
	8 | unsigned int apollo_irq_startup(struct irq_data *data)
	  |              ^~~~~~~~~~~~~~~~~~
    arch/m68k/apollo/dn_ints.c:19:6: warning: no previous prototype for ‘apollo_irq_shutdown’ [-Wmissing-prototypes]
       19 | void apollo_irq_shutdown(struct irq_data *data)
	  |      ^~~~~~~~~~~~~~~~~~~
    arch/m68k/apollo/dn_ints.c:29:6: warning: no previous prototype for ‘apollo_irq_eoi’ [-Wmissing-prototypes]
       29 | void apollo_irq_eoi(struct irq_data *data)
	  |      ^~~~~~~~~~~~~~

Fix this by making all local functions static.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/apollo/config.c  | 8 ++++----
 arch/m68k/apollo/dn_ints.c | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index fccbb40772dca6b9..0e6801eecbaf6361 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -29,7 +29,7 @@ u_long apollo_model;
 extern void dn_sched_init(void);
 extern void dn_init_IRQ(void);
 extern int dn_dummy_hwclk(int, struct rtc_time *);
-extern void dn_dummy_reset(void);
+static void dn_dummy_reset(void);
 #ifdef CONFIG_HEARTBEAT
 static void dn_heartbeat(int on);
 #endif
@@ -107,7 +107,7 @@ static void __init dn_setup_model(void)
 
 }
 
-void dn_serial_print (const char *str)
+static void dn_serial_print(const char *str)
 {
     while (*str) {
         if (*str == '\n') {
@@ -207,8 +207,8 @@ int dn_dummy_hwclk(int op, struct rtc_time *t) {
 
 }
 
-void dn_dummy_reset(void) {
-
+static void dn_dummy_reset(void)
+{
   dn_serial_print("The end !\n");
 
   for(;;);
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
index 02cff7efc8342aa6..d97251fe0ab83045 100644
--- a/arch/m68k/apollo/dn_ints.c
+++ b/arch/m68k/apollo/dn_ints.c
@@ -5,7 +5,7 @@
 #include <asm/traps.h>
 #include <asm/apollohw.h>
 
-unsigned int apollo_irq_startup(struct irq_data *data)
+static unsigned int apollo_irq_startup(struct irq_data *data)
 {
 	unsigned int irq = data->irq;
 
@@ -16,7 +16,7 @@ unsigned int apollo_irq_startup(struct irq_data *data)
 	return 0;
 }
 
-void apollo_irq_shutdown(struct irq_data *data)
+static void apollo_irq_shutdown(struct irq_data *data)
 {
 	unsigned int irq = data->irq;
 
@@ -26,7 +26,7 @@ void apollo_irq_shutdown(struct irq_data *data)
 		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
 }
 
-void apollo_irq_eoi(struct irq_data *data)
+static void apollo_irq_eoi(struct irq_data *data)
 {
 	*(volatile unsigned char *)(pica) = 0x20;
 	*(volatile unsigned char *)(picb) = 0x20;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (23 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 24/52] m68k: apollo: Make local reset, serial, and irq functions static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 26/52] m68k: apollo: Add and use "apollo.h" Geert Uytterhoeven
                   ` (26 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/apollo/config.c: In function ‘dn_timer_int’:
    arch/m68k/apollo/config.c:171:32: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
      149 |         volatile unsigned char x;
	  |                                ^

Fix this by using READ_ONCE(), and removing the variable.
As READ_ONCE() casts to volatile internally, remove the existing cast.
Deduplicate the remaining casts by introducing an intermediary.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by,
  - Remove volatile and dedup casts, as suggested by Finn.
---
 arch/m68k/apollo/config.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 0e6801eecbaf6361..7afefb0191504d4e 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -146,13 +146,13 @@ void __init config_apollo(void)
 
 irqreturn_t dn_timer_int(int irq, void *dev_id)
 {
-	volatile unsigned char x;
+	unsigned char *at = (unsigned char *)apollo_timer;
 
 	legacy_timer_tick(1);
 	timer_heartbeat();
 
-	x = *(volatile unsigned char *)(apollo_timer + 3);
-	x = *(volatile unsigned char *)(apollo_timer + 5);
+	READ_ONCE(*(at + 3));
+	READ_ONCE(*(at + 5));
 
 	return IRQ_HANDLED;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 26/52] m68k: apollo: Add and use "apollo.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (24 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 27/52] m68k: bvme6000: Make bvme6000_abort_int() static Geert Uytterhoeven
                   ` (25 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/apollo/dn_ints.c:43:13: warning: no previous prototype for ‘dn_init_IRQ’ [-Wmissing-prototypes]
       43 | void __init dn_init_IRQ(void)
	  |             ^~~~~~~~~~~

Fix this by introducing a new header file "apollo.h" for holding the
prototypes of functions implemented in arch/m68k/apollo/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/apollo/apollo.h  | 4 ++++
 arch/m68k/apollo/config.c  | 3 ++-
 arch/m68k/apollo/dn_ints.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 arch/m68k/apollo/apollo.h

diff --git a/arch/m68k/apollo/apollo.h b/arch/m68k/apollo/apollo.h
new file mode 100644
index 0000000000000000..1fe9d856df30354c
--- /dev/null
+++ b/arch/m68k/apollo/apollo.h
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/* dn_ints.c */
+void dn_init_IRQ(void);
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 7afefb0191504d4e..e161ecd76035862d 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -17,6 +17,8 @@
 #include <asm/machdep.h>
 #include <asm/config.h>
 
+#include "apollo.h"
+
 u_long sio01_physaddr;
 u_long sio23_physaddr;
 u_long rtc_physaddr;
@@ -27,7 +29,6 @@ u_long timer_physaddr;
 u_long apollo_model;
 
 extern void dn_sched_init(void);
-extern void dn_init_IRQ(void);
 extern int dn_dummy_hwclk(int, struct rtc_time *);
 static void dn_dummy_reset(void);
 #ifdef CONFIG_HEARTBEAT
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
index d97251fe0ab83045..ba96a92f8f18f00a 100644
--- a/arch/m68k/apollo/dn_ints.c
+++ b/arch/m68k/apollo/dn_ints.c
@@ -5,6 +5,8 @@
 #include <asm/traps.h>
 #include <asm/apollohw.h>
 
+#include "apollo.h"
+
 static unsigned int apollo_irq_startup(struct irq_data *data)
 {
 	unsigned int irq = data->irq;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 27/52] m68k: bvme6000: Make bvme6000_abort_int() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (25 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 26/52] m68k: apollo: Add and use "apollo.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 28/52] m68k: hp300: Include "time.h" for hp300_sched_init() Geert Uytterhoeven
                   ` (24 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/bvme6000/config.c:133:13: warning: no previous prototype for ‘bvme6000_abort_int’ [-Wmissing-prototypes]
      133 | irqreturn_t bvme6000_abort_int (int irq, void *dev_id)
	  |             ^~~~~~~~~~~~~~~~~~

Fix this by making bvme6000_abort_int() static.
There was never a user outside arch/m68k/bvme6000/config.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/bvme6000/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 3a1d90e399e016cf..e604fe6602461334 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -130,7 +130,7 @@ void __init config_bvme6000(void)
 }
 
 
-irqreturn_t bvme6000_abort_int (int irq, void *dev_id)
+static irqreturn_t bvme6000_abort_int(int irq, void *dev_id)
 {
         unsigned long *new = (unsigned long *)vectors;
         unsigned long *old = (unsigned long *)0xf8000000;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 28/52] m68k: hp300: Include "time.h" for hp300_sched_init()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (26 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 27/52] m68k: bvme6000: Make bvme6000_abort_int() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 29/52] m68k: mac: Remove unused sine_data[] Geert Uytterhoeven
                   ` (23 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/hp300/time.c:101:13: warning: no previous prototype for ‘hp300_sched_init’ [-Wmissing-prototypes]
      101 | void __init hp300_sched_init(void)
	  |             ^~~~~~~~~~~~~~~~

Fix this by including "time.h".

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/hp300/time.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c
index 1d1b7b3b5dd41583..72621fb9f3e663bd 100644
--- a/arch/m68k/hp300/time.c
+++ b/arch/m68k/hp300/time.c
@@ -20,6 +20,8 @@
 #include <asm/traps.h>
 #include <asm/blinken.h>
 
+#include "time.h"
+
 static u64 hp300_read_clk(struct clocksource *cs);
 
 static struct clocksource hp300_clk = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 29/52] m68k: mac: Remove unused sine_data[]
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (27 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 28/52] m68k: hp300: Include "time.h" for hp300_sched_init() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 30/52] m68k: mac: Remove unused yday in unmktime() Geert Uytterhoeven
                   ` (22 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mac/macboing.c:29:26: warning: ‘sine_data’ defined but not used [-Wunused-const-variable=]
       29 | static const signed char sine_data[] = {
	  |                          ^~~~~~~~~

The predefined sine table was superseded by a table calculated at
run-time in v2.2.0.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mac/macboing.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
index 4de6229c7bfdebce..76431241347682fc 100644
--- a/arch/m68k/mac/macboing.c
+++ b/arch/m68k/mac/macboing.c
@@ -22,15 +22,6 @@ static int mac_asc_inited;
  */
 static __u8 mac_asc_wave_tab[ 0x800 ];
 
-/*
- * Alan's original sine table; needs interpolating to 0x800
- * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric)
- */
-static const signed char sine_data[] = {
-	0,  39,  75,  103,  121,  127,  121,  103,  75,  39,
-	0, -39, -75, -103, -121, -127, -121, -103, -75, -39
-};
-
 /*
  * where the ASC hides ...
  */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 30/52] m68k: mac: Remove unused yday in unmktime()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (28 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 29/52] m68k: mac: Remove unused sine_data[] Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 31/52] m68k: mac: Make mac_platform_init() static Geert Uytterhoeven
                   ` (21 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mac/misc.c: In function ‘unmktime’:
    arch/m68k/mac/misc.c:557:33: warning: variable ‘yday’ set but not used [-Wunused-but-set-variable]
      557 |         int days, rem, y, wday, yday;
	  |                                 ^~~~

Fix this by removing the unused variable and assignment.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mac/misc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index c7cb29f0ff016360..65107abc8848232c 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -554,7 +554,7 @@ static void unmktime(time64_t time, long offset,
 		/* Leap years.  */
 		{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
 	};
-	int days, rem, y, wday, yday;
+	int days, rem, y, wday;
 	const unsigned short int *ip;
 
 	days = div_u64_rem(time, SECS_PER_DAY, &rem);
@@ -592,7 +592,6 @@ static void unmktime(time64_t time, long offset,
 		y = yg;
 	}
 	*yearp = y - 1900;
-	yday = days; /* day in the year.  Not currently used. */
 	ip = __mon_yday[__isleap(y)];
 	for (y = 11; days < (long int) ip[y]; --y)
 		continue;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 31/52] m68k: mac: Make mac_platform_init() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (29 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 30/52] m68k: mac: Remove unused yday in unmktime() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 32/52] m68k: mac: Add and use "mac.h" Geert Uytterhoeven
                   ` (20 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mac/config.c:961:12: warning: no previous prototype for ‘mac_platform_init’ [-Wmissing-prototypes]
      961 | int __init mac_platform_init(void)
	  |            ^~~~~~~~~~~~~~~~~

Fix this by making mac_platform_init() static.
There was never a user outside arch/m68k/mac/config.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mac/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 382f656c29eaeef2..d56affefd5cabeb5 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -958,7 +958,7 @@ static const struct pata_platform_info mac_pata_data __initconst = {
 	.ioport_shift = 2,
 };
 
-int __init mac_platform_init(void)
+static int __init mac_platform_init(void)
 {
 	phys_addr_t swim_base = 0;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 32/52] m68k: mac: Add and use "mac.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (30 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 31/52] m68k: mac: Make mac_platform_init() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 33/52] m68k: mvme147: Make mvme147_init_IRQ() static Geert Uytterhoeven
                   ` (19 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mac/iop.c:235:13: warning: no previous prototype for ‘iop_init’ [-Wmissing-prototypes]
      235 | void __init iop_init(void)
	  |             ^~~~~~~~
    arch/m68k/mac/via.c:112:13: warning: no previous prototype for ‘via_init’ [-Wmissing-prototypes]
      111 | void __init via_init(void)
	  |             ^~~~~~~~
    arch/m68k/mac/via.c:623:13: warning: no previous prototype for ‘via_init_clock’ [-Wmissing-prototypes]
      593 | void __init via_init_clock(void)
	  |             ^~~~~~~~~~~~~~
    arch/m68k/mac/oss.c:37:13: warning: no previous prototype for ‘oss_init’ [-Wmissing-prototypes]
       37 | void __init oss_init(void)
	  |             ^~~~~~~~
    arch/m68k/mac/psc.c:76:13: warning: no previous prototype for ‘psc_init’ [-Wmissing-prototypes]
       76 | void __init psc_init(void)
	  |             ^~~~~~~~
    arch/m68k/mac/baboon.c:25:13: warning: no previous prototype for ‘baboon_init’ [-Wmissing-prototypes]
       25 | void __init baboon_init(void)
	  |             ^~~~~~~~~~~
    arch/m68k/mac/macboing.c:155:6: warning: no previous prototype for ‘mac_mksound’ [-Wmissing-prototypes]
      155 | void mac_mksound( unsigned int freq, unsigned int length )
	  |      ^~~~~~~~~~~
    arch/m68k/mac/misc.c:608:5: warning: no previous prototype for ‘mac_hwclk’ [-Wmissing-prototypes]
      608 | int mac_hwclk(int op, struct rtc_time *t)
	  |     ^~~~~~~~~

Fix this by introducing a new header file "mac.h" for holding the
prototypes of functions implemented in arch/m68k/mac/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mac/baboon.c   |  2 ++
 arch/m68k/mac/config.c   | 12 ++----------
 arch/m68k/mac/iop.c      |  2 ++
 arch/m68k/mac/mac.h      | 25 +++++++++++++++++++++++++
 arch/m68k/mac/macboing.c |  2 ++
 arch/m68k/mac/misc.c     |  2 ++
 arch/m68k/mac/oss.c      |  2 ++
 arch/m68k/mac/psc.c      |  2 ++
 arch/m68k/mac/via.c      |  2 ++
 9 files changed, 41 insertions(+), 10 deletions(-)
 create mode 100644 arch/m68k/mac/mac.h

diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index a7d280220662c747..5c97a7058bcdee2e 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -15,6 +15,8 @@
 #include <asm/macints.h>
 #include <asm/mac_baboon.h>
 
+#include "mac.h"
+
 int baboon_present;
 static volatile struct baboon *baboon;
 
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index d56affefd5cabeb5..e324410ef239c09f 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -50,22 +50,14 @@
 #include <asm/mac_psc.h>
 #include <asm/config.h>
 
+#include "mac.h"
+
 /* Mac bootinfo struct */
 struct mac_booter_data mac_bi_data;
 
 /* The phys. video addr. - might be bogus on some machines */
 static unsigned long mac_orig_videoaddr;
 
-extern int mac_hwclk(int, struct rtc_time *);
-extern void iop_init(void);
-extern void via_init(void);
-extern void via_init_clock(void);
-extern void oss_init(void);
-extern void psc_init(void);
-extern void baboon_init(void);
-
-extern void mac_mksound(unsigned int, unsigned int);
-
 static void mac_get_model(char *str);
 static void mac_identify(void);
 static void mac_report_hardware(void);
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index 010b3b5ae8e8584a..a92740d530ac4fbe 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -119,6 +119,8 @@
 #include <asm/macints.h>
 #include <asm/mac_iop.h>
 
+#include "mac.h"
+
 #ifdef DEBUG
 #define iop_pr_debug(fmt, ...) \
 	printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__)
diff --git a/arch/m68k/mac/mac.h b/arch/m68k/mac/mac.h
new file mode 100644
index 0000000000000000..d3d142cea3b4b911
--- /dev/null
+++ b/arch/m68k/mac/mac.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+struct rtc_time;
+
+/* baboon.c */
+void baboon_init(void);
+
+/* iop.c */
+void iop_init(void);
+
+/* misc.c */
+int mac_hwclk(int op, struct rtc_time *t);
+
+/* macboing.c */
+void mac_mksound(unsigned int freq, unsigned int length);
+
+/* oss.c */
+void oss_init(void);
+
+/* psc.c */
+void psc_init(void);
+
+/* via.c */
+void via_init(void);
+void via_init_clock(void);
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
index 76431241347682fc..faea2265a540192d 100644
--- a/arch/m68k/mac/macboing.c
+++ b/arch/m68k/mac/macboing.c
@@ -16,6 +16,8 @@
 #include <asm/macintosh.h>
 #include <asm/mac_asc.h>
 
+#include "mac.h"
+
 static int mac_asc_inited;
 /*
  * dumb triangular wave table
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 65107abc8848232c..4c8f8cbfa05f3404 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -25,6 +25,8 @@
 
 #include <asm/machdep.h>
 
+#include "mac.h"
+
 /*
  * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU
  * times wrap in 2040. If we need to handle later times, the read_time functions
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 921e6c092f2c6626..1641607f300d981c 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -27,6 +27,8 @@
 #include <asm/mac_via.h>
 #include <asm/mac_oss.h>
 
+#include "mac.h"
+
 int oss_present;
 volatile struct mac_oss *oss;
 
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index 0d0965b19c09b439..b4183cf66efef7f5 100644
--- a/arch/m68k/mac/psc.c
+++ b/arch/m68k/mac/psc.c
@@ -26,6 +26,8 @@
 #include <asm/macints.h>
 #include <asm/mac_psc.h>
 
+#include "mac.h"
+
 #define DEBUG_PSC
 
 volatile __u8 *psc;
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 3d11d6219cdd56da..01e6b0e37f8dd0e8 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -38,6 +38,8 @@
 #include <asm/mac_psc.h>
 #include <asm/mac_oss.h>
 
+#include "mac.h"
+
 volatile __u8 *via1, *via2;
 int rbv_present;
 int via_alt_mapping;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 33/52] m68k: mvme147: Make mvme147_init_IRQ() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (31 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 32/52] m68k: mac: Add and use "mac.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 34/52] m68k: mvme16x: Remove unused sink in mvme16x_cons_write() Geert Uytterhoeven
                   ` (18 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mvme147/config.c:76:13: warning: no previous prototype for ‘mvme147_init_IRQ’ [-Wmissing-prototypes]
       76 | void __init mvme147_init_IRQ(void)
	  |             ^~~~~~~~~~~~~~~~

Fix this by making mvme147_init_IRQ() static.
The function body was moved to arch/m68k/mvme147/config.c in v2.6.18.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mvme147/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 4e6218115f43ce56..7dfacd0b207a9750 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -73,7 +73,7 @@ static void mvme147_get_model(char *model)
  * the mvme147 IRQ handling routines.
  */
 
-void __init mvme147_init_IRQ(void)
+static void __init mvme147_init_IRQ(void)
 {
 	m68k_setup_user_interrupt(VEC_USER, 192);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 34/52] m68k: mvme16x: Remove unused sink in mvme16x_cons_write()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (32 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 33/52] m68k: mvme147: Make mvme147_init_IRQ() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 35/52] m68k: mvme16x: Add and use "mvme16x.h" Geert Uytterhoeven
                   ` (17 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mvme16x/config.c: In function ‘mvme16x_cons_write’:
    arch/m68k/mvme16x/config.c:211:25: warning: variable ‘sink’ set but not used [-Wunused-but-set-variable]
      211 |         volatile u_char sink;
	  |                         ^~~~

Fix this by removing the unused variable and assignment.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/mvme16x/config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index f00c7aa058dec2f3..b6833862ea6b1530 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -208,7 +208,6 @@ static void __init mvme16x_init_IRQ (void)
 void mvme16x_cons_write(struct console *co, const char *str, unsigned count)
 {
 	volatile unsigned char *base_addr = (u_char *)CD2401_ADDR;
-	volatile u_char sink;
 	u_char ier;
 	int port;
 	u_char do_lf = 0;
@@ -229,7 +228,7 @@ void mvme16x_cons_write(struct console *co, const char *str, unsigned count)
 		if (in_8(PCCSCCTICR) & 0x20)
 		{
 			/* We have a Tx int. Acknowledge it */
-			sink = in_8(PCCTPIACKR);
+			in_8(PCCTPIACKR);
 			if ((base_addr[CyLICR] >> 2) == port) {
 				if (i == count) {
 					/* Last char of string is now output */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 35/52] m68k: mvme16x: Add and use "mvme16x.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (33 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 34/52] m68k: mvme16x: Remove unused sink in mvme16x_cons_write() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 36/52] m68k: q40: Add and use "q40.h" Geert Uytterhoeven
                   ` (16 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/mvme16x/config.c:208:6: warning: no previous prototype for ‘mvme16x_cons_write’ [-Wmissing-prototypes]
      208 | void mvme16x_cons_write(struct console *co, const char *str, unsigned count)
	  |      ^~~~~~~~~~~~~~~~~~

Fix this by introducing a new header file "mvme16x.h" for holding the
prototypes of functions implemented in arch/m68k/mvme16x/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/early_printk.c | 4 ++--
 arch/m68k/mvme16x/config.c      | 2 ++
 arch/m68k/mvme16x/mvme16x.h     | 6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 arch/m68k/mvme16x/mvme16x.h

diff --git a/arch/m68k/kernel/early_printk.c b/arch/m68k/kernel/early_printk.c
index 7d3fe08a48eb0319..3cc944df04f65ef1 100644
--- a/arch/m68k/kernel/early_printk.c
+++ b/arch/m68k/kernel/early_printk.c
@@ -12,8 +12,8 @@
 #include <linux/string.h>
 #include <asm/setup.h>
 
-extern void mvme16x_cons_write(struct console *co,
-			       const char *str, unsigned count);
+
+#include "../mvme16x/mvme16x.h"
 
 asmlinkage void __init debug_cons_nputs(const char *s, unsigned n);
 
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index b6833862ea6b1530..9bb9a33e43c246c4 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -38,6 +38,8 @@
 #include <asm/mvme16xhw.h>
 #include <asm/config.h>
 
+#include "mvme16x.h"
+
 extern t_bdid mvme_bdid;
 
 static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
diff --git a/arch/m68k/mvme16x/mvme16x.h b/arch/m68k/mvme16x/mvme16x.h
new file mode 100644
index 0000000000000000..159c34b700394116
--- /dev/null
+++ b/arch/m68k/mvme16x/mvme16x.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+struct console;
+
+/* config.c */
+void mvme16x_cons_write(struct console *co, const char *str, unsigned count);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 36/52] m68k: q40: Add and use "q40.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (34 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 35/52] m68k: mvme16x: Add and use "mvme16x.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 37/52] m68k: sun3/3x: Include <asm/config.h> for config_sun3*() Geert Uytterhoeven
                   ` (15 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/q40/q40ints.c:84:13: warning: no previous prototype for ‘q40_init_IRQ’ [-Wmissing-prototypes]
       84 | void __init q40_init_IRQ(void)
	  |             ^~~~~~~~~~~~
    arch/m68k/q40/q40ints.c:112:6: warning: no previous prototype for ‘q40_mksound’ [-Wmissing-prototypes]
      112 | void q40_mksound(unsigned int hz, unsigned int ticks)
	  |      ^~~~~~~~~~~
    arch/m68k/q40/q40ints.c:152:6: warning: no previous prototype for ‘q40_sched_init’ [-Wmissing-prototypes]
      152 | void q40_sched_init (void)
	  |      ^~~~~~~~~~~~~~

Fix this by introducing a new header file "q40.h" for holding the
prototypes of functions implemented in arch/m68k/q40/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/q40/config.c  | 6 ++----
 arch/m68k/q40/q40.h     | 6 ++++++
 arch/m68k/q40/q40ints.c | 2 ++
 3 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 arch/m68k/q40/q40.h

diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index c78ee709b45879c7..2c51c2b4a4fbbf79 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -36,16 +36,14 @@
 #include <asm/q40_master.h>
 #include <asm/config.h>
 
-extern void q40_init_IRQ(void);
+#include "q40.h"
+
 static void q40_get_model(char *model);
-extern void q40_sched_init(void);
 
 static int q40_hwclk(int, struct rtc_time *);
 static int q40_get_rtc_pll(struct rtc_pll_info *pll);
 static int q40_set_rtc_pll(struct rtc_pll_info *pll);
 
-extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/);
-
 static void q40_mem_console_write(struct console *co, const char *b,
 				  unsigned int count);
 
diff --git a/arch/m68k/q40/q40.h b/arch/m68k/q40/q40.h
new file mode 100644
index 0000000000000000..3146679bde0dab97
--- /dev/null
+++ b/arch/m68k/q40/q40.h
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* q40ints.c */
+void q40_init_IRQ(void);
+void q40_mksound(unsigned int hz, unsigned int ticks);
+void q40_sched_init(void);
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
index 127d7ecdbd49ecd9..10f1f294e91f9705 100644
--- a/arch/m68k/q40/q40ints.c
+++ b/arch/m68k/q40/q40ints.c
@@ -24,6 +24,8 @@
 #include <asm/q40_master.h>
 #include <asm/q40ints.h>
 
+#include "q40.h"
+
 /*
  * Q40 IRQs are defined as follows:
  *            3,4,5,6,7,10,11,14,15 : ISA dev IRQs
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 37/52] m68k: sun3/3x: Include <asm/config.h> for config_sun3*()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (35 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 36/52] m68k: q40: Add and use "q40.h" Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 38/52] m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h> Geert Uytterhoeven
                   ` (14 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/config.c:123:13: warning: no previous prototype for ‘config_sun3’ [-Wmissing-prototypes]
      126 | void __init config_sun3(void)
	  |             ^~~~~~~~~~~
    arch/m68k/sun3x/config.c:42:13: warning: no previous prototype for ‘config_sun3x’ [-Wmissing-prototypes]
       42 | void __init config_sun3x(void)
	  |             ^~~~~~~~~~~~

Fix this by including <asm/config.h>

Fixes: 91d7b75a5888c182 ("m68k: Add asm/config.h")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/config.c  | 1 +
 arch/m68k/sun3x/config.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 203f428a0344a735..b932250c9e7ffbae 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -32,6 +32,7 @@
 #include <asm/irq.h>
 #include <asm/sections.h>
 #include <asm/sun3ints.h>
+#include <asm/config.h>
 
 char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
 
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index 37121a0f12531fef..3a10cda636fc38fb 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -19,6 +19,7 @@
 #include <asm/sun3ints.h>
 #include <asm/setup.h>
 #include <asm/oplib.h>
+#include <asm/config.h>
 
 #include "time.h"
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 38/52] m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h>
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (36 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 37/52] m68k: sun3/3x: Include <asm/config.h> for config_sun3*() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 39/52] m68k: sun3: Fix context restore in flush_tlb_range() Geert Uytterhoeven
                   ` (13 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/dvma.c:65:13: warning: no previous prototype for ‘sun3_dvma_init’ [-Wmissing-prototypes]
       65 | void __init sun3_dvma_init(void)
	  |             ^~~~~~~~~~~~~~

    arch/m68k/sun3x/dvma.c:178:6: warning: no previous prototype for ‘dvma_unmap_iommu’ [-Wmissing-prototypes]
      179 | void dvma_unmap_iommu(unsigned long baddr, int len)
	  |      ^~~~~~~~~~~~~~~~

Fix this by moving the declarations for sun3_dvma_init() and
dvma_unmap_iommu() to <asm/dvma.h>.  Avoid #ifdefs in callers by
providing dummy static inline functions.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/include/asm/dvma.h |  8 +++++++-
 arch/m68k/sun3/sun3dvma.c    | 15 ---------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/arch/m68k/include/asm/dvma.h b/arch/m68k/include/asm/dvma.h
index f609ec1de36d0d2c..d1d66d04844d3e1c 100644
--- a/arch/m68k/include/asm/dvma.h
+++ b/arch/m68k/include/asm/dvma.h
@@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr);
 #define dvma_vtob(x) dvma_vtop(x)
 #define dvma_btov(x) dvma_ptov(x)
 
+void sun3_dvma_init(void);
+
 static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
 			       int len)
 {
 	return 0;
 }
 
+static inline void dvma_unmap_iommu(unsigned long baddr, int len) { }
+
 #else /* Sun3x */
 
 /* sun3x dvma page support */
@@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
 #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff)
 #define dvma_btov(x) ((unsigned long)(x) | 0xff000000)
 
-extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
+static inline void sun3_dvma_init(void) { }
 
+int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
 
+void dvma_unmap_iommu(unsigned long baddr, int len);
 
 /* everything below this line is specific to dma used for the onboard
    ESP scsi on sun3x */
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index 4b560f4d3960c2b5..f66b2413209069f2 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -20,18 +20,6 @@
 
 #undef DVMA_DEBUG
 
-#ifdef CONFIG_SUN3X
-extern void dvma_unmap_iommu(unsigned long baddr, int len);
-#else
-static inline void dvma_unmap_iommu(unsigned long a, int b)
-{
-}
-#endif
-
-#ifdef CONFIG_SUN3
-extern void sun3_dvma_init(void);
-#endif
-
 static unsigned long *iommu_use;
 
 #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
@@ -274,10 +262,7 @@ void __init dvma_init(void)
 
 	dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
 
-#ifdef CONFIG_SUN3
 	sun3_dvma_init();
-#endif
-
 }
 
 unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 39/52] m68k: sun3: Fix context restore in flush_tlb_range()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (37 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 38/52] m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h> Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 40/52] m68k: sun3: Fix signature of sun3_get_model() Geert Uytterhoeven
                   ` (12 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    In file included from arch/m68k/kernel/traps.c:42:
    arch/m68k/include/asm/tlbflush.h: In function ‘flush_tlb_range’:
    arch/m68k/include/asm/tlbflush.h:191:28: warning: variable ‘oldctx’ set but not used [-Wunused-but-set-variable]
      191 |         unsigned char seg, oldctx;
	  |                            ^~~~~~

Indeed, the old context is saved, but never restored.  Fix this by
adding the missing call to sun3_put_context().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.

Compile-tested only.
This issue seems to have been present since the introduction of Sun3
support in v2.4.0.
---
 arch/m68k/include/asm/tlbflush.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h
index b882e2f4f5516f8d..3ab329a03c76c8d8 100644
--- a/arch/m68k/include/asm/tlbflush.h
+++ b/arch/m68k/include/asm/tlbflush.h
@@ -208,6 +208,7 @@ static inline void flush_tlb_range (struct vm_area_struct *vma,
 	next:
 		start += SUN3_PMEG_SIZE;
 	}
+	sun3_put_context(oldctx);
 }
 
 static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 40/52] m68k: sun3: Fix signature of sun3_get_model()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (38 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 39/52] m68k: sun3: Fix context restore in flush_tlb_range() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 41/52] m68k: sun3: Add missing asmlinkage to sun3_init() Geert Uytterhoeven
                   ` (11 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

The mach_get_model() callback takes a "char *", not an
"unsigned char *".

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/idprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
index 1ace5353d78f5377..9ffd6515ad74a7fa 100644
--- a/arch/m68k/sun3/idprom.c
+++ b/arch/m68k/sun3/idprom.c
@@ -83,7 +83,7 @@ static void __init display_system_type(unsigned char machtype)
 	prom_halt();
 }
 
-void sun3_get_model(unsigned char* model)
+void sun3_get_model(char *model)
 {
 	register int i;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 41/52] m68k: sun3: Add missing asmlinkage to sun3_init()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (39 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 40/52] m68k: sun3: Fix signature of sun3_get_model() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 42/52] m68k: sun3: Remove unused orig_baddr in free_baddr() Geert Uytterhoeven
                   ` (10 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

sun3_init() is called from assembly code, so it should be marked
asmlinkage for documentation purposes.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index b932250c9e7ffbae..4550cf25b6f0880a 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/memblock.h>
 #include <linux/platform_device.h>
+#include <linux/linkage.h>
 
 #include <asm/oplib.h>
 #include <asm/setup.h>
@@ -49,7 +50,7 @@ static void sun3_get_hardware_list(struct seq_file *m)
 	seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid);
 }
 
-void __init sun3_init(void)
+asmlinkage void __init sun3_init(void)
 {
 	unsigned char enable_register;
 	int i;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 42/52] m68k: sun3: Remove unused orig_baddr in free_baddr()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (40 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 41/52] m68k: sun3: Add missing asmlinkage to sun3_init() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 43/52] m68k: sun3: Remove unused start_page in sun3_bootmem_alloc() Geert Uytterhoeven
                   ` (9 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/sun3dvma.c: In function ‘free_baddr’:
    arch/m68k/sun3/sun3dvma.c:208:23: warning: variable ‘orig_baddr’ set but not used [-Wunused-but-set-variable]
      196 |         unsigned long orig_baddr;
	  |                       ^~~~~~~~~~

Fix this by removing the unused variable and assignment, which were
futile since their introduction in v2.4.5.2.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/sun3dvma.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index f66b2413209069f2..6ebf52740ad7c00d 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -193,9 +193,7 @@ static inline int free_baddr(unsigned long baddr)
 	unsigned long len;
 	struct hole *hole;
 	struct list_head *cur;
-	unsigned long orig_baddr;
 
-	orig_baddr = baddr;
 	len = dvma_entry_use(baddr);
 	dvma_entry_use(baddr) = 0;
 	baddr &= DVMA_PAGE_MASK;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 43/52] m68k: sun3: Remove unused start_page in sun3_bootmem_alloc()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (41 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 42/52] m68k: sun3: Remove unused orig_baddr in free_baddr() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 44/52] m68k: sun3: Remove unused vsprintf() return value in prom_printf() Geert Uytterhoeven
                   ` (8 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/config.c: In function ‘sun3_bootmem_alloc’:
    arch/m68k/sun3/config.c:110:23: warning: variable ‘start_page’ set but not used [-Wunused-but-set-variable]
      112 |         unsigned long start_page;
	  |                       ^~~~~~~~~~

Fix this by removing the variable and the assignment, now the last user
is gone.

Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/config.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 4550cf25b6f0880a..6e24920e4195490b 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -109,13 +109,10 @@ static void sun3_halt (void)
 static void __init sun3_bootmem_alloc(unsigned long memory_start,
 				      unsigned long memory_end)
 {
-	unsigned long start_page;
-
 	/* align start/end to page boundaries */
 	memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK);
 	memory_end = memory_end & PAGE_MASK;
 
-	start_page = __pa(memory_start) >> PAGE_SHIFT;
 	max_pfn = num_pages = __pa(memory_end) >> PAGE_SHIFT;
 
 	high_memory = (void *)memory_end;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 44/52] m68k: sun3: Remove unused vsprintf() return value in prom_printf()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (42 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 43/52] m68k: sun3: Remove unused start_page in sun3_bootmem_alloc() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 45/52] m68k: sun3: Annotate prom_printf() with __printf() Geert Uytterhoeven
                   ` (7 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’:
    arch/m68k/sun3/prom/printf.c:28:13: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
       28 |         int i;
	  |             ^

As the return value of vsprintf() is unused, and serves no practical
purpose here, fix this by removing the variable.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/prom/printf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c
index b6724cc6679579bd..db5537ef12504a8b 100644
--- a/arch/m68k/sun3/prom/printf.c
+++ b/arch/m68k/sun3/prom/printf.c
@@ -25,15 +25,14 @@ prom_printf(char *fmt, ...)
 {
 	va_list args;
 	char ch, *bptr;
-	int i;
 
 	va_start(args, fmt);
 
 #ifdef CONFIG_KGDB
 	ppbuf[0] = 'O';
-	i = vsprintf(ppbuf + 1, fmt, args) + 1;
+	vsprintf(ppbuf + 1, fmt, args) + 1;
 #else
-	i = vsprintf(ppbuf, fmt, args);
+	vsprintf(ppbuf, fmt, args);
 #endif
 
 	bptr = ppbuf;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 45/52] m68k: sun3: Annotate prom_printf() with __printf()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (43 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 44/52] m68k: sun3: Remove unused vsprintf() return value in prom_printf() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 46/52] m68k: sun3: Make print_pte() static Geert Uytterhoeven
                   ` (6 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’:
    arch/m68k/sun3/prom/printf.c:35:9: warning: function ‘prom_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
       35 |         vsprintf(ppbuf, fmt, args);
	  |         ^~~~~~~~

Fix this by annotating prom_printf() with __printf(1, 2).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/include/asm/oplib.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/oplib.h b/arch/m68k/include/asm/oplib.h
index 48cb4fd09f8d9cce..6d5ea67c65d044c1 100644
--- a/arch/m68k/include/asm/oplib.h
+++ b/arch/m68k/include/asm/oplib.h
@@ -9,6 +9,8 @@
 #ifndef __SPARC_OPLIB_H
 #define __SPARC_OPLIB_H
 
+#include <linux/compiler.h>
+
 #include <asm/openprom.h>
 
 /* The master romvec pointer... */
@@ -149,7 +151,7 @@ extern char prom_getchar(void);
 extern void prom_putchar(char character);
 
 /* Prom's internal printf routine, don't use in kernel/boot code. */
-void prom_printf(char *fmt, ...);
+__printf(1, 2) void prom_printf(char *fmt, ...);
 
 /* Query for input device type */
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 46/52] m68k: sun3: Make print_pte() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (44 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 45/52] m68k: sun3: Annotate prom_printf() with __printf() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 47/52] m68k: sun3: Make sun3_platform_init() static Geert Uytterhoeven
                   ` (5 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/mmu_emu.c:70:6: warning: no previous prototype for ‘print_pte’ [-Wmissing-prototypes]
       70 | void print_pte (pte_t pte)
	  |      ^~~~~~~~~

Fix this by making print_pte() static.
There was never a user outside arch/m68k/sun3/mmu_emu.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/mmu_emu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 7321b3b76283c7c9..7ec9bbf8a3644a10 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -67,7 +67,7 @@ static unsigned char ctx_avail = CONTEXTS_NUM-1;
 unsigned long rom_pages[256];
 
 /* Print a PTE value in symbolic form. For debugging. */
-void print_pte (pte_t pte)
+static void print_pte(pte_t pte)
 {
 #if 0
 	/* Verbose version. */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 47/52] m68k: sun3: Make sun3_platform_init() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (45 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 46/52] m68k: sun3: Make print_pte() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 48/52] m68k: sun3x: Fix signature of sun3_leds() Geert Uytterhoeven
                   ` (4 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/config.c:201:12: warning: no previous prototype for ‘sun3_platform_init’ [-Wmissing-prototypes]
      202 | int __init sun3_platform_init(void)
	  |            ^~~~~~~~~~~~~~~~~~

Fix this by making sun3_platform_init() static.
There was never a user outside arch/m68k/sun3/config.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 6e24920e4195490b..40796c3e84400def 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -199,7 +199,7 @@ static const struct resource sun3_scsi_rsrc[] __initconst = {
 	},
 };
 
-int __init sun3_platform_init(void)
+static int __init sun3_platform_init(void)
 {
 	switch (idprom->id_machtype) {
 	case SM_SUN3 | SM_3_160:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 48/52] m68k: sun3x: Fix signature of sun3_leds()
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (46 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 47/52] m68k: sun3: Make sun3_platform_init() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 49/52] m68k: sun3x: Do not mark dvma_map_iommu() inline Geert Uytterhoeven
                   ` (3 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

The sun3_leds() implementation for Sun3 in arch/m68k/sun3/leds.c, and
the prototype in arch/m68k/sun3/sun3ints.c take an "unsigned char", not
an "int".  Align the dummy implementation for Sun3x with the Sun3
variant and the common caller.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3x/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index 3a10cda636fc38fb..e2a5d84df6d214d1 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -27,7 +27,7 @@ volatile char *clock_va;
 
 extern void sun3_get_model(char *model);
 
-void sun3_leds(unsigned int i)
+void sun3_leds(unsigned char byte)
 {
 
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 49/52] m68k: sun3x: Do not mark dvma_map_iommu() inline
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (47 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 48/52] m68k: sun3x: Fix signature of sun3_leds() Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 50/52] m68k: sun3x: Make sun3x_halt() static Geert Uytterhoeven
                   ` (2 subsequent siblings)
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

dvma_map_iommu() is called from the common Sun3/3x DVMA management code,
but never from inside arch/m68k/sun3x/dvma.c.  Hence it does not make
sense to mark it inline.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3x/dvma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c
index a6034ba058454642..d1847bfa136791e2 100644
--- a/arch/m68k/sun3x/dvma.c
+++ b/arch/m68k/sun3x/dvma.c
@@ -143,8 +143,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
 }
 
 
-inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
-				 int len)
+int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, int len)
 {
 	unsigned long end, index;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 50/52] m68k: sun3x: Make sun3x_halt() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (48 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 49/52] m68k: sun3x: Do not mark dvma_map_iommu() inline Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 51/52] m68k: sun3x: Make dvma_print() static Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 52/52] m68k: sun3/3x: Add and use "sun3.h" Geert Uytterhoeven
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3x/prom.c:33:6: warning: no previous prototype for ‘sun3x_halt’ [-Wmissing-prototypes]
       33 | void sun3x_halt(void)
	  |      ^~~~~~~~~~

Fix this by making sun3x_halt() static.
The function body was moved to arch/m68k/sun3x/prom.c in v2.4.5.2.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3x/prom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c
index 64c23bfaa90c5ba9..8ac87d3dc60718d9 100644
--- a/arch/m68k/sun3x/prom.c
+++ b/arch/m68k/sun3x/prom.c
@@ -30,7 +30,7 @@ struct linux_romvec *romvec;
 e_vector *sun3x_prom_vbr;
 
 /* Handle returning to the prom */
-void sun3x_halt(void)
+static void sun3x_halt(void)
 {
 	unsigned long flags;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 51/52] m68k: sun3x: Make dvma_print() static
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (49 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 50/52] m68k: sun3x: Make sun3x_halt() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  2023-09-13 14:08 ` [PATCH v2 52/52] m68k: sun3/3x: Add and use "sun3.h" Geert Uytterhoeven
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

There was never a user of dvma_print() outside arch/m68k/sun3x/dvma.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/sun3x/dvma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c
index d1847bfa136791e2..5185b4818d408e71 100644
--- a/arch/m68k/sun3x/dvma.c
+++ b/arch/m68k/sun3x/dvma.c
@@ -60,7 +60,7 @@ static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU;
 
 #ifdef DEBUG
 /* code to print out a dvma mapping for debugging purposes */
-void dvma_print (unsigned long dvma_addr)
+static void dvma_print (unsigned long dvma_addr)
 {
 
 	unsigned long index;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 52/52] m68k: sun3/3x: Add and use "sun3.h"
  2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
                   ` (50 preceding siblings ...)
  2023-09-13 14:08 ` [PATCH v2 51/52] m68k: sun3x: Make dvma_print() static Geert Uytterhoeven
@ 2023-09-13 14:08 ` Geert Uytterhoeven
  51 siblings, 0 replies; 53+ messages in thread
From: Geert Uytterhoeven @ 2023-09-13 14:08 UTC (permalink / raw)
  To: linux-m68k
  Cc: Arnd Bergmann, Finn Thain, Michael Schmitz, Philip Blundell,
	Greg Ungerer, Joshua Thompson, Sam Creasey, Laurent Vivier,
	linux-kernel, Geert Uytterhoeven

When building with W=1:

    arch/m68k/sun3/idprom.c:86:6: warning: no previous prototype for ‘sun3_get_model’ [-Wmissing-prototypes]
       86 | void sun3_get_model(char *model)
	  |      ^~~~~~~~~~~~~~
    arch/m68k/sun3/config.c:53:24: warning: no previous prototype for ‘sun3_init’ [-Wmissing-prototypes]
       53 | asmlinkage void __init sun3_init(void)
	  |                        ^~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:117:6: warning: no previous prototype for ‘print_pte_vaddr’ [-Wmissing-prototypes]
      117 | void print_pte_vaddr (unsigned long vaddr)
	  |      ^~~~~~~~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:126:13: warning: no previous prototype for ‘mmu_emu_init’ [-Wmissing-prototypes]
      126 | void __init mmu_emu_init(unsigned long bootmem_end)
	  |             ^~~~~~~~~~~~
    arch/m68k/sun3/mmu_emu.c:353:5: warning: no previous prototype for ‘mmu_emu_handle_fault’ [-Wmissing-prototypes]
      353 | int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
	  |     ^~~~~~~~~~~~~~~~~~~~
    arch/m68k/sun3/leds.c:6:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes]
	6 | void sun3_leds(unsigned char byte)
	  |      ^~~~~~~~~
    arch/m68k/sun3/intersil.c:27:5: warning: no previous prototype for ‘sun3_hwclk’ [-Wmissing-prototypes]
       27 | int sun3_hwclk(int set, struct rtc_time *t)
	  |     ^~~~~~~~~~
    arch/m68k/sun3x/config.c:30:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes]
       30 | void sun3_leds(unsigned char byte)
	  |      ^~~~~~~~~

Fix this by introducing a new header file "sun3.h" for holding the
prototypes of functions implemented in arch/m68k/sun3/ and
arch/m68k/sun3x/.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
v2:
  - Add Acked-by.
---
 arch/m68k/kernel/traps.c  |  2 +-
 arch/m68k/mm/sun3kmap.c   |  6 ++----
 arch/m68k/mm/sun3mmu.c    |  2 +-
 arch/m68k/sun3/config.c   |  4 ++--
 arch/m68k/sun3/idprom.c   |  2 ++
 arch/m68k/sun3/intersil.c |  1 +
 arch/m68k/sun3/leds.c     |  2 ++
 arch/m68k/sun3/mmu_emu.c  |  1 +
 arch/m68k/sun3/sun3.h     | 22 ++++++++++++++++++++++
 arch/m68k/sun3/sun3ints.c |  2 +-
 arch/m68k/sun3x/config.c  |  3 +--
 11 files changed, 36 insertions(+), 11 deletions(-)
 create mode 100644 arch/m68k/sun3/sun3.h

diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 129c89349e1a40aa..8ee773d29954921c 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -364,7 +364,7 @@ static inline void access_error040(struct frame *fp)
 #if defined(CONFIG_SUN3)
 #include <asm/sun3mmu.h>
 
-extern int mmu_emu_handle_fault (unsigned long, int, int);
+#include "../sun3/sun3.h"
 
 /* sun3 version of bus_error030 */
 
diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c
index 4f2a7ef8348bc1a6..ac091892d82f8a06 100644
--- a/arch/m68k/mm/sun3kmap.c
+++ b/arch/m68k/mm/sun3kmap.c
@@ -18,11 +18,9 @@
 #include <asm/io.h>
 #include <asm/sun3mmu.h>
 
-#undef SUN3_KMAP_DEBUG
+#include "../sun3/sun3.h"
 
-#ifdef SUN3_KMAP_DEBUG
-extern void print_pte_vaddr(unsigned long vaddr);
-#endif
+#undef SUN3_KMAP_DEBUG
 
 extern void mmu_emu_map_pmeg (int context, int vaddr);
 
diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c
index c5e6a23e0262128d..494739c1783e4dea 100644
--- a/arch/m68k/mm/sun3mmu.c
+++ b/arch/m68k/mm/sun3mmu.c
@@ -24,7 +24,7 @@
 #include <asm/machdep.h>
 #include <asm/io.h>
 
-extern void mmu_emu_init (unsigned long bootmem_end);
+#include "../sun3/sun3.h"
 
 const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
 
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 40796c3e84400def..cd8af809e0cad1e4 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -35,11 +35,11 @@
 #include <asm/sun3ints.h>
 #include <asm/config.h>
 
+#include "sun3.h"
+
 char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
 
 static void sun3_sched_init(void);
-extern void sun3_get_model (char* model);
-extern int sun3_hwclk(int set, struct rtc_time *t);
 
 volatile char* clock_va;
 extern unsigned long availmem;
diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
index 9ffd6515ad74a7fa..ca633a5f5eb1281a 100644
--- a/arch/m68k/sun3/idprom.c
+++ b/arch/m68k/sun3/idprom.c
@@ -17,6 +17,8 @@
 #include <asm/idprom.h>
 #include <asm/machines.h>  /* Fun with Sun released architectures. */
 
+#include "sun3.h"
+
 struct idprom *idprom;
 EXPORT_SYMBOL(idprom);
 
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c
index 8fc74864de81962b..29674cfa9bb3aa35 100644
--- a/arch/m68k/sun3/intersil.c
+++ b/arch/m68k/sun3/intersil.c
@@ -17,6 +17,7 @@
 #include <asm/intersil.h>
 #include <asm/machdep.h>
 
+#include "sun3.h"
 
 /* bits to set for start/run of the intersil */
 #define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c
index 7c67b58ebf13fa4a..4bb95318fd548302 100644
--- a/arch/m68k/sun3/leds.c
+++ b/arch/m68k/sun3/leds.c
@@ -3,6 +3,8 @@
 #include <asm/sun3mmu.h>
 #include <asm/io.h>
 
+#include "sun3.h"
+
 void sun3_leds(unsigned char byte)
 {
 	unsigned char dfc;
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 7ec9bbf8a3644a10..e5a92da43d1978df 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -27,6 +27,7 @@
 #include <asm/mmu_context.h>
 #include <asm/dvma.h>
 
+#include "sun3.h"
 
 #undef DEBUG_MMU_EMU
 #define DEBUG_PROM_MAPS
diff --git a/arch/m68k/sun3/sun3.h b/arch/m68k/sun3/sun3.h
new file mode 100644
index 0000000000000000..8d98c0aaedc0c686
--- /dev/null
+++ b/arch/m68k/sun3/sun3.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/linkage.h>
+
+struct rtc_time;
+
+/* config.c */
+asmlinkage void sun3_init(void);
+
+/* idprom.c */
+void sun3_get_model(char *model);
+
+/* intersil.c */
+int sun3_hwclk(int set, struct rtc_time *t);
+
+/* leds.c */
+void sun3_leds(unsigned char byte);
+
+/* mmu_emu.c */
+void mmu_emu_init(unsigned long bootmem_end);
+int mmu_emu_handle_fault(unsigned long vaddr, int read_flag, int kernel_fault);
+void print_pte_vaddr(unsigned long vaddr);
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index 36cc280a4505f5d2..781e7c0a6f523a2b 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -17,7 +17,7 @@
 #include <asm/irq_regs.h>
 #include <linux/seq_file.h>
 
-extern void sun3_leds (unsigned char);
+#include "sun3.h"
 
 void sun3_disable_interrupts(void)
 {
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index e2a5d84df6d214d1..798ea72a0ea3c3e2 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -22,11 +22,10 @@
 #include <asm/config.h>
 
 #include "time.h"
+#include "../sun3/sun3.h"
 
 volatile char *clock_va;
 
-extern void sun3_get_model(char *model);
-
 void sun3_leds(unsigned char byte)
 {
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2023-09-13 14:10 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13 14:07 [PATCH v2 00/52] m68k: W=1 fixes Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 01/52] m68k: kernel: Add missing asmlinkage to do_notify_resume() Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 02/52] m68k: kernel: Include <linux/cpu.h> for trap_init() Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 03/52] m68k: kernel: Make bad_super_trap() static Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 04/52] m68k: kernel: Add and use <asm/syscalls.h> Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 05/52] m68k: kernel: Add and use "ints.h" Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 06/52] m68k: kernel: Add and use "process.h" Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 07/52] m68k: kernel: Add and use "ptrace.h" Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 08/52] m68k: kernel: Add and use "signal.h" Geert Uytterhoeven
2023-09-13 14:07 ` [PATCH v2 09/52] m68k: kernel: Add and use "traps.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 10/52] m68k: kernel: Add and use "vectors.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 11/52] m68k: mm: Include <asm/hwtest.h> for hwreg_() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 12/52] m68k: mm: Move paging_init() to common <asm/pgtable.h> Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 13/52] m68k: mm: Add and use "fault.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 14/52] m68k: emu: Remove unused vsnprintf() return value in nfprint() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 15/52] m68k: emu: Mark version[] __maybe_unused Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 16/52] m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 17/52] m68k: amiga: Add and use "amiga.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 18/52] m68k: atari: Document data parameter of stdma_try_lock() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 19/52] m68k: atari: Make ikbd_reset() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 20/52] m68k: atari: Make atari_platform_init() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 21/52] m68k: atari: Make atari_stram_map_pages() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 22/52] m68k: atari: Add and use "atari.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 23/52] m68k: apollo: Remove unused debug console functions Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 24/52] m68k: apollo: Make local reset, serial, and irq functions static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 26/52] m68k: apollo: Add and use "apollo.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 27/52] m68k: bvme6000: Make bvme6000_abort_int() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 28/52] m68k: hp300: Include "time.h" for hp300_sched_init() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 29/52] m68k: mac: Remove unused sine_data[] Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 30/52] m68k: mac: Remove unused yday in unmktime() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 31/52] m68k: mac: Make mac_platform_init() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 32/52] m68k: mac: Add and use "mac.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 33/52] m68k: mvme147: Make mvme147_init_IRQ() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 34/52] m68k: mvme16x: Remove unused sink in mvme16x_cons_write() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 35/52] m68k: mvme16x: Add and use "mvme16x.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 36/52] m68k: q40: Add and use "q40.h" Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 37/52] m68k: sun3/3x: Include <asm/config.h> for config_sun3*() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 38/52] m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h> Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 39/52] m68k: sun3: Fix context restore in flush_tlb_range() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 40/52] m68k: sun3: Fix signature of sun3_get_model() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 41/52] m68k: sun3: Add missing asmlinkage to sun3_init() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 42/52] m68k: sun3: Remove unused orig_baddr in free_baddr() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 43/52] m68k: sun3: Remove unused start_page in sun3_bootmem_alloc() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 44/52] m68k: sun3: Remove unused vsprintf() return value in prom_printf() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 45/52] m68k: sun3: Annotate prom_printf() with __printf() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 46/52] m68k: sun3: Make print_pte() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 47/52] m68k: sun3: Make sun3_platform_init() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 48/52] m68k: sun3x: Fix signature of sun3_leds() Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 49/52] m68k: sun3x: Do not mark dvma_map_iommu() inline Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 50/52] m68k: sun3x: Make sun3x_halt() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 51/52] m68k: sun3x: Make dvma_print() static Geert Uytterhoeven
2023-09-13 14:08 ` [PATCH v2 52/52] m68k: sun3/3x: Add and use "sun3.h" Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox