From: Arnd Bergmann <arnd@arndb.de>
I slightly dropped the ball on this since last sending the series in
August, but a number of warning fixes have made it into the kernel in
the meantime, both from my earlier submission and from architecture
maintainers.
I have none patches that remain from the previous submission, with
two of them reworked according to comments. The additional patches
are from more testing across architectures and configurations that
I had previously missed.
At least one patch is for a newly added warning in recent kernels.
Regarding the regressions in terms of added warnings, there are
now only five architectures left that add warnings (alpha, mips,
nios2, sh and sparc) rather than 15, so I think we can apply
the Kbuild change directly and have the architecture maintainers
take care of the warnings just like the others did already.
As before, my preference would be for the patches to make it
through the respective subsystem maintainer trees, though I
can apply the architecture specific ones to the asm-generic
tree as well.
Sorry for posting these during the merge window, I wanted to
get them out before LPC so we can have them in linux-next
as early as possible.
Arnd
Link: https://lore.kernel.org/lkml/20230810141947.1236730-1-arnd@kernel.org/
Arnd Bergmann (22):
[RESEND^2] ida: make 'ida_dump' static
[RESEND^2] jffs2: mark __jffs2_dbg_superblock_counts() static
[RESEND] kprobes: unify kprobes_exceptions_nofify() prototypes
[RESEND] time: make sysfs_get_uname() function visible in header
[RESEND] parport: gsc: mark init function static
[RESEND] stackleak: add declarations for global functions
[RESEND] sched: fair: move unused stub functions to header
[v2] arch: consolidate arch_irq_work_raise prototypes
[v2] arch: fix asm-offsets.c building with -Wmissing-prototypes
microblaze: include linux/cpu.h for trap_init() prototype
x86: sta2x11: include header for sta2x11_get_instance() prototype
csky: fix arch_jump_label_transform_static override
arch: add do_page_fault prototypes
arch: add missing prepare_ftrace_return() prototypes
arch: vdso: consolidate gettime prototypes
bcachefs: mark bch2_target_to_text_sb() static
powerpc: ps3: move udbg_shutdown_ps3gelic prototype
powerpc: pasemi: mark pas_shutdown() static
powerpc: powermac: mark smp_psurge_{give,take}_timebase static
usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static
fbdev/fsl-diu-fb: mark wr_reg_wa() static
Makefile.extrawarn: turn on missing-prototypes globally
arch/alpha/include/asm/mmu_context.h | 2 ++
arch/alpha/kernel/asm-offsets.c | 2 +-
arch/alpha/kernel/traps.c | 1 +
arch/arc/include/asm/kprobes.h | 3 ---
arch/arm/include/asm/irq_work.h | 2 --
arch/arm/include/asm/kprobes.h | 2 --
arch/arm/include/asm/vdso.h | 5 ----
arch/arm/vdso/vgettimeofday.c | 1 +
arch/arm64/include/asm/irq_work.h | 2 --
arch/arm64/include/asm/kprobes.h | 2 --
arch/arm64/kernel/vdso32/vgettimeofday.c | 1 +
arch/csky/include/asm/ftrace.h | 4 +++
arch/csky/include/asm/irq_work.h | 2 +-
arch/csky/include/asm/jump_label.h | 5 ++++
arch/csky/include/asm/traps.h | 2 +-
arch/csky/kernel/traps.c | 1 +
arch/csky/kernel/vdso/vgettimeofday.c | 11 +--------
arch/loongarch/kernel/asm-offsets.c | 26 ++++++++++----------
arch/loongarch/vdso/vgettimeofday.c | 7 +-----
arch/m68k/coldfire/vectors.c | 3 +--
arch/m68k/coldfire/vectors.h | 3 ---
arch/microblaze/include/asm/ftrace.h | 1 +
arch/microblaze/kernel/traps.c | 1 +
arch/mips/include/asm/ftrace.h | 4 +++
arch/mips/include/asm/kprobes.h | 2 --
arch/mips/include/asm/traps.h | 3 +++
arch/mips/vdso/vgettimeofday.c | 1 +
arch/nios2/include/asm/traps.h | 2 ++
arch/powerpc/include/asm/irq_work.h | 1 -
arch/powerpc/include/asm/kprobes.h | 2 --
arch/powerpc/include/asm/ps3.h | 6 +++++
arch/powerpc/platforms/pasemi/setup.c | 2 +-
arch/powerpc/platforms/powermac/smp.c | 4 +--
arch/powerpc/platforms/ps3/gelic_udbg.c | 1 +
arch/riscv/include/asm/irq_work.h | 2 +-
arch/riscv/kernel/vdso/vgettimeofday.c | 7 +-----
arch/s390/include/asm/irq_work.h | 2 --
arch/s390/include/asm/kprobes.h | 2 --
arch/sh/include/asm/kprobes.h | 2 --
arch/sh/include/asm/traps_32.h | 3 +++
arch/sparc/include/asm/kprobes.h | 2 --
arch/sparc/kernel/asm-offsets.c | 6 ++---
arch/sparc/kernel/traps_32.c | 1 +
arch/sparc/kernel/traps_64.c | 1 +
arch/x86/entry/vdso/vclock_gettime.c | 10 +-------
arch/x86/include/asm/irq_work.h | 1 -
arch/x86/include/asm/kprobes.h | 2 --
arch/x86/include/asm/traps.h | 1 -
arch/x86/include/asm/vdso/gettimeofday.h | 2 --
arch/x86/kernel/traps.c | 1 +
arch/x86/pci/sta2x11-fixup.c | 1 +
arch/x86/um/vdso/um_vdso.c | 1 +
drivers/net/ethernet/toshiba/ps3_gelic_net.h | 6 -----
drivers/parport/parport_gsc.c | 2 +-
drivers/usb/host/fsl-mph-dr-of.c | 2 +-
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
fs/bcachefs/disk_groups.c | 2 +-
fs/jffs2/debug.c | 2 +-
include/linux/irq_work.h | 3 +++
include/linux/kprobes.h | 4 +++
include/linux/stackleak.h | 6 +++++
include/vdso/gettime.h | 23 +++++++++++++++++
kernel/sched/fair.c | 13 ----------
kernel/sched/sched.h | 11 +++++++++
kernel/time/tick-internal.h | 3 ++-
lib/test_ida.c | 2 +-
scripts/Makefile.extrawarn | 4 +--
67 files changed, 127 insertions(+), 122 deletions(-)
delete mode 100644 arch/m68k/coldfire/vectors.h
create mode 100644 include/vdso/gettime.h
--
2.39.2
Cc: Matt Turner <mattst88@gmail.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Guo Ren <guoren@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <redacted>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Thomas Gleixner <redacted>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org
Cc: Helge Deller <deller@gmx.de>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Timur Tabi <timur@kernel.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "Naveen N. Rao" <redacted>
Cc: Anil S Keshavamurthy <redacted>
Cc: Kees Cook <redacted>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nicolas Schier <redacted>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Uwe Kleine-König" <redacted>
Cc: linux-alpha@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-trace-kernel@vger.kernel.org
Cc: linux-csky@vger.kernel.org
Cc: loongarch@lists.linux.dev
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-mips@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-s390@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-bcachefs@vger.kernel.org
Cc: linux-mtd@lists.infradead.org
Cc: linux-kbuild@vger.kernel.org
From: Arnd Bergmann <arnd@arndb.de>
There is no global declaration for ida_dump() and no other
callers, so make it static to avoid this warning:
lib/test_ida.c:16:6: error: no previous prototype for 'ida_dump'
Fixes: 8ab8ba38d488 ("ida: Start new test_ida module")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
lib/test_ida.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arnd Bergmann <arnd@arndb.de>
This function is only called locally and does not need to be
global. Since there is no external prototype, gcc warns about
the non-static definition:
fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/jffs2/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arnd Bergmann <arnd@arndb.de>
This function is only called locally and does not need to be
global. Since there is no external prototype, gcc warns about
the non-static definition:
fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/jffs2/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arnd Bergmann <arnd@arndb.de>
Most architectures that support kprobes declare this function in their
own asm/kprobes.h header and provide an override, but some are missing
the prototype, which causes a warning for the __weak stub implementation:
kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes]
1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self,
Move the prototype into linux/kprobes.h so it is visible to all
the definitions.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arc/include/asm/kprobes.h | 3 ---
arch/arm/include/asm/kprobes.h | 2 --
arch/arm64/include/asm/kprobes.h | 2 --
arch/mips/include/asm/kprobes.h | 2 --
arch/powerpc/include/asm/kprobes.h | 2 --
arch/s390/include/asm/kprobes.h | 2 --
arch/sh/include/asm/kprobes.h | 2 --
arch/sparc/include/asm/kprobes.h | 2 --
arch/x86/include/asm/kprobes.h | 2 --
include/linux/kprobes.h | 4 ++++
10 files changed, 4 insertions(+), 19 deletions(-)
On Wed, 8 Nov 2023 13:58:24 +0100
Arnd Bergmann [off-list ref] wrote:
From: Arnd Bergmann <arnd@arndb.de>
Most architectures that support kprobes declare this function in their
own asm/kprobes.h header and provide an override, but some are missing
the prototype, which causes a warning for the __weak stub implementation:
kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes]
1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self,
Move the prototype into linux/kprobes.h so it is visible to all
the definitions.
From: Arnd Bergmann <arnd@arndb.de>
This function is defined globally in clocksource.c and used conditionally
in clockevent.c, which the declaration hidden when clockevent support
is disabled. This causes a harmless warning in the definition:
kernel/time/clocksource.c:1324:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1324 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
Move the declaration out of the #ifdef so it is always visible.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/time/tick-internal.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Hello Arnd,
On Wed, Nov 08, 2023 at 01:58:25PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
This function is defined globally in clocksource.c and used conditionally
in clockevent.c, which the declaration hidden when clockevent support
s/which/with/ ?
is disabled. This causes a harmless warning in the definition:
kernel/time/clocksource.c:1324:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1324 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
Move the declaration out of the #ifdef so it is always visible.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Other than that:
Reviewed-by: Uwe Kleine-König <redacted>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
From: Arnd Bergmann <arnd@arndb.de>
This is only used locally, so mark it static to avoid a warning:
drivers/parport/parport_gsc.c:395:5: error: no previous prototype for 'parport_gsc_init' [-Werror=missing-prototypes]
Acked-by: Helge Deller <deller@gmx.de>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/parport/parport_gsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arnd Bergmann <arnd@arndb.de>
With -Wmissing-prototypes enabled, the stackleak code produces a couple of
warnings that have no declarations because they are only called from assembler:
stackleak.c:127:25: error: no previous prototype for 'stackleak_erase' [-Werror=missing-prototypes]
stackleak.c:139:25: error: no previous prototype for 'stackleak_erase_on_task_stack' [-Werror=missing-prototypes]
stackleak.c:151:25: error: no previous prototype for 'stackleak_erase_off_task_stack' [-Werror=missing-prototypes]
stackleak.c:159:49: error: no previous prototype for 'stackleak_track_stack' [-Werror=missing-prototypes]
Add declarations to the stackleak header to shut up the warnings.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/stackleak.h | 6 ++++++
1 file changed, 6 insertions(+)
From: Arnd Bergmann <arnd@arndb.de>
These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED,
and empty one that is only referenced when FAIR_GROUP_SCHED is disabled
but CGROUP_SCHED is still enabled. If both are turned off, the functions
are still defined but the misisng prototype causes a W=1 warning:
kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group'
kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_group'
kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_sched_group'
kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_fair_sched_group'
Move the alternatives into the header as static inline functions with
the correct combination of #ifdef checks to avoid the warning without
adding even more complexity.
[A different patch with the same description got applied by accident
and was later reverted, but the original patch is still missing]
Fixes: 7aa55f2a5902 ("sched/fair: Move unused stub functions to header")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
A patch with the same commit log has
---
kernel/sched/fair.c | 13 -------------
kernel/sched/sched.h | 11 +++++++++++
2 files changed, 11 insertions(+), 13 deletions(-)
From: Arnd Bergmann <arnd@arndb.de>
The prototype was hidden in an #ifdef on x86, which causes a warning:
kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]
Some architectures have a working prototype, while others don't.
Fix this by providing it in only one place that is always visible.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Palmer Dabbelt <redacted>
Acked-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: clarify changelog text
---
arch/arm/include/asm/irq_work.h | 2 --
arch/arm64/include/asm/irq_work.h | 2 --
arch/csky/include/asm/irq_work.h | 2 +-
arch/powerpc/include/asm/irq_work.h | 1 -
arch/riscv/include/asm/irq_work.h | 2 +-
arch/s390/include/asm/irq_work.h | 2 --
arch/x86/include/asm/irq_work.h | 1 -
include/linux/irq_work.h | 3 +++
8 files changed, 5 insertions(+), 10 deletions(-)
On Wed, Nov 8, 2023 at 2:01 PM Arnd Bergmann [off-list ref] wrote:
From: Arnd Bergmann <arnd@arndb.de>
The prototype was hidden in an #ifdef on x86, which causes a warning:
kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]
This issue is now present upstream.
Some architectures have a working prototype, while others don't.
Fix this by providing it in only one place that is always visible.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Palmer Dabbelt <redacted>
Acked-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
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
On Wed, Jan 10, 2024, at 10:03, Geert Uytterhoeven wrote:
On Wed, Nov 8, 2023 at 2:01 PM Arnd Bergmann [off-list ref] wrote:
quoted
From: Arnd Bergmann <arnd@arndb.de>
The prototype was hidden in an #ifdef on x86, which causes a warning:
kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]
This issue is now present upstream.
quoted
Some architectures have a working prototype, while others don't.
Fix this by providing it in only one place that is always visible.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Palmer Dabbelt <redacted>
Acked-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
When -Wmissing-prototypes is enabled, the some asm-offsets.c files fail
to build, even when this warning is disabled in the Makefile for normal
files:
arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype for 'sparc32_foo' [-Werror=missing-prototypes]
arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for 'foo' [-Werror=missing-prototypes]
Address this by making use of the same trick as x86, marking these
functions as 'static __used' to avoid the need for a prototype
by not drop them in dead-code elimination.
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/lkml/CAK7LNARfEmFk0Du4Hed19eX_G6tUC5wG0zP+L1AyvdpOF4ybXQ@mail.gmail.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: rewrite using a different approach
---
arch/alpha/kernel/asm-offsets.c | 2 +-
arch/loongarch/kernel/asm-offsets.c | 26 +++++++++++++-------------
arch/sparc/kernel/asm-offsets.c | 6 +++---
3 files changed, 17 insertions(+), 17 deletions(-)
From: Sam Ravnborg <hidden> Date: 2023-11-08 19:12:04
On Wed, Nov 08, 2023 at 01:58:30PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
When -Wmissing-prototypes is enabled, the some asm-offsets.c files fail
to build, even when this warning is disabled in the Makefile for normal
files:
arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype for 'sparc32_foo' [-Werror=missing-prototypes]
arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for 'foo' [-Werror=missing-prototypes]
Address this by making use of the same trick as x86, marking these
functions as 'static __used' to avoid the need for a prototype
by not drop them in dead-code elimination.
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/lkml/CAK7LNARfEmFk0Du4Hed19eX_G6tUC5wG0zP+L1AyvdpOF4ybXQ@mail.gmail.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Looks good. I sometimes looks at sparc patches so I looked at this one.
Reviewed-by: Sam Ravnborg <redacted>
From: Arnd Bergmann <arnd@arndb.de>
sta2x11_get_instance() is a global function declared in asm/sta2x11.h,
but this header is not included before the definition, causing a warning:
arch/x86/pci/sta2x11-fixup.c:95:26: error: no previous prototype for 'sta2x11_get_instance' [-Werror=missing-prototypes]
Add the missing #include.
Fixes: 83125a3a189e ("x86, platform: Initial support for sta2x11 I/O hub")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/pci/sta2x11-fixup.c | 1 +
1 file changed, 1 insertion(+)
From: Arnd Bergmann <arnd@arndb.de>
The arch_jump_label_transform_static() function in csky was originally meant to
override the generic __weak function, but that got changed to an #ifndef check.
This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]
Change the method to use the new method of having a #define and a prototype
for the global function.
Fixes: 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes: 4e8bb4ba5a55 ("csky: Add jump-label implementation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/csky/include/asm/jump_label.h | 5 +++++
1 file changed, 5 insertions(+)
On Wed, Nov 8, 2023 at 8:02 AM Arnd Bergmann [off-list ref] wrote:
quoted hunk
From: Arnd Bergmann <arnd@arndb.de>
The arch_jump_label_transform_static() function in csky was originally meant to
override the generic __weak function, but that got changed to an #ifndef check.
This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]
Change the method to use the new method of having a #define and a prototype
for the global function.
Fixes: 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes: 4e8bb4ba5a55 ("csky: Add jump-label implementation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/csky/include/asm/jump_label.h | 5 +++++
1 file changed, 5 insertions(+)
From: Arnd Bergmann <arnd@arndb.de>
The prototype for prepare_ftrace_return() is architecture specific and
can't be in a global header. Since it's normally called from assembly,
it doesn't really need a prototype, but we get a warning if it's missing:
arch/csky/kernel/ftrace.c:147:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes]
arch/microblaze/kernel/ftrace.c:22:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes]
arch/mips/kernel/ftrace.c:305:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes]
Add the prototypes for the three architectures that don't already have
one in asm/ftrace.h.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/csky/include/asm/ftrace.h | 4 ++++
arch/microblaze/include/asm/ftrace.h | 1 +
arch/mips/include/asm/ftrace.h | 4 ++++
3 files changed, 9 insertions(+)
From: Arnd Bergmann <arnd@arndb.de>
The VDSO functions are defined as globals in the kernel sources but intended
to be called from userspace, so there is no need to declare them in a kernel
side header.
Without a prototype, this now causes warnings such as
arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]
Most architectures have already added workarounds for these by adding
declarations somewhere, but since these are all compatible, we should
really just have one copy, with an #ifdef check for the 32-bit vs
64-bit variant and use that everywhere.
Unfortunately, the sparc version is currently incompatible since
that never added support for __vdso_clock_gettime64() in 32-bit
userland. For the moment, I'm leaving this one out, as I can't
easily test it and it requires a larger rework.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/include/asm/vdso.h | 5 -----
arch/arm/vdso/vgettimeofday.c | 1 +
arch/arm64/kernel/vdso32/vgettimeofday.c | 1 +
arch/csky/kernel/vdso/vgettimeofday.c | 11 +----------
arch/loongarch/vdso/vgettimeofday.c | 7 +------
arch/mips/vdso/vgettimeofday.c | 1 +
arch/riscv/kernel/vdso/vgettimeofday.c | 7 +------
arch/x86/entry/vdso/vclock_gettime.c | 10 +---------
arch/x86/include/asm/vdso/gettimeofday.h | 2 --
arch/x86/um/vdso/um_vdso.c | 1 +
include/vdso/gettime.h | 23 +++++++++++++++++++++++
11 files changed, 31 insertions(+), 38 deletions(-)
create mode 100644 include/vdso/gettime.h
@@ -35,9 +33,6 @@ __kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alias("__v#if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64)/* both 64-bit and x32 use these */-externint__vdso_clock_gettime(clockid_tclock,struct__kernel_timespec*ts);-externint__vdso_clock_getres(clockid_tclock,struct__kernel_timespec*res);-int__vdso_clock_gettime(clockid_tclock,struct__kernel_timespec*ts){return__cvdso_clock_gettime(clock,ts);
@@ -56,9 +51,6 @@ int clock_getres(clockid_t, struct __kernel_timespec *)#else/* i386 only */-externint__vdso_clock_gettime(clockid_tclock,structold_timespec32*ts);-externint__vdso_clock_getres(clockid_tclock,structold_timespec32*res);-int__vdso_clock_gettime(clockid_tclock,structold_timespec32*ts){return__cvdso_clock_gettime32(clock,ts);
Hi Arnd,
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
From: Arnd Bergmann <arnd@arndb.de>
The VDSO functions are defined as globals in the kernel sources but intended
to be called from userspace, so there is no need to declare them in a kernel
side header.
Without a prototype, this now causes warnings such as
arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]
Most architectures have already added workarounds for these by adding
declarations somewhere, but since these are all compatible, we should
really just have one copy, with an #ifdef check for the 32-bit vs
64-bit variant and use that everywhere.
Unfortunately, the sparc version is currently incompatible since
that never added support for __vdso_clock_gettime64() in 32-bit
userland. For the moment, I'm leaving this one out, as I can't
easily test it and it requires a larger rework.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/include/asm/vdso.h | 5 -----
arch/arm/vdso/vgettimeofday.c | 1 +
arch/arm64/kernel/vdso32/vgettimeofday.c | 1 +
arch/csky/kernel/vdso/vgettimeofday.c | 11 +----------
arch/loongarch/vdso/vgettimeofday.c | 7 +------
arch/mips/vdso/vgettimeofday.c | 1 +
arch/riscv/kernel/vdso/vgettimeofday.c | 7 +------
arch/x86/entry/vdso/vclock_gettime.c | 10 +---------
arch/x86/include/asm/vdso/gettimeofday.h | 2 --
arch/x86/um/vdso/um_vdso.c | 1 +
include/vdso/gettime.h | 23 +++++++++++++++++++++++
11 files changed, 31 insertions(+), 38 deletions(-)
create mode 100644 include/vdso/gettime.h
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
Christophe
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote:
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
I don't actually know, my initial interpretation was that
these function names are part of the user ABI for the vdso,
but I never looked closely enough at how vdso works to
be sure what the actual ABI is.
If __c_kernel_clock_gettime() etc are not part of the user-facing
ABI, I think renaming them for consistency with the other
architectures would be best.
Arnd
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote:
quoted
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
quoted
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
I don't actually know, my initial interpretation was that
these function names are part of the user ABI for the vdso,
but I never looked closely enough at how vdso works to
be sure what the actual ABI is.
If __c_kernel_clock_gettime() etc are not part of the user-facing
ABI, I think renaming them for consistency with the other
architectures would be best.
User-facing ABI function is __kernel_clock_gettime(), defined in
arch/powerpc/kernel/vdso/gettimeofday.S , see man vdso.
There is no prototype defined for it anywhere, obviously that's
undetected because it is assembly. Should a prototype be added somewhere
anyway ?
__kernel_clock_gettime() sets up a stack frame, retrieves the address of
the datapage then calls __c_kernel_clock_gettime() which then calls
__cvdso_clock_gettime_data() which is part of the generic CVDSO.
Maybe that's too different from what other architectures do ?
Christophe
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2023-11-09 10:19:28
"Arnd Bergmann" [off-list ref] writes:
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote:
quoted
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
quoted
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
I don't actually know, my initial interpretation was that
these function names are part of the user ABI for the vdso,
but I never looked closely enough at how vdso works to
be sure what the actual ABI is.
AFAIK the ABI is just the symbols we export, as defined in the linker
script:
/*
* This controls what symbols we export from the DSO.
*/
VERSION
{
VDSO_VERSION_STRING {
global:
__kernel_get_syscall_map;
__kernel_gettimeofday;
__kernel_clock_gettime;
__kernel_clock_getres;
__kernel_get_tbfreq;
__kernel_sync_dicache;
__kernel_sigtramp_rt64;
__kernel_getcpu;
__kernel_time;
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117
If __c_kernel_clock_gettime() etc are not part of the user-facing
ABI, I think renaming them for consistency with the other
architectures would be best.
The __c symbols are not part of the ABI, so we could rename them.
At the moment though they don't have the same prototype as the generic
versions, because we find the VDSO data in asm and pass it to the C
functions, eg:
int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,
const struct vdso_data *vd);
I think we can rework that though, by implementing
__arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able
to share the prototypes.
cheers
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote:
quoted
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
quoted
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
I don't actually know, my initial interpretation was that
these function names are part of the user ABI for the vdso,
but I never looked closely enough at how vdso works to
be sure what the actual ABI is.
AFAIK the ABI is just the symbols we export, as defined in the linker
script:
/*
* This controls what symbols we export from the DSO.
*/
VERSION
{
VDSO_VERSION_STRING {
global:
__kernel_get_syscall_map;
__kernel_gettimeofday;
__kernel_clock_gettime;
__kernel_clock_getres;
__kernel_get_tbfreq;
__kernel_sync_dicache;
__kernel_sigtramp_rt64;
__kernel_getcpu;
__kernel_time;
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117
quoted
If __c_kernel_clock_gettime() etc are not part of the user-facing
ABI, I think renaming them for consistency with the other
architectures would be best.
The __c symbols are not part of the ABI, so we could rename them.
At the moment though they don't have the same prototype as the generic
versions, because we find the VDSO data in asm and pass it to the C
functions, eg:
int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,
const struct vdso_data *vd);
I think we can rework that though, by implementing
__arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able
to share the prototypes.
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2023-11-09 12:23:35
Christophe Leroy [off-list ref] writes:
Le 09/11/2023 à 11:18, Michael Ellerman a écrit :
quoted
"Arnd Bergmann" [off-list ref] writes:
quoted
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote:
quoted
Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :
quoted
powerpc has functions doing more or less the same, they are called
__c_kernel_clock_gettime() and alike with their prototypes siting in
arch/powerpc/include/asm/vdso/gettimeofday.h
Should those prototypes be moved to include/vdso/gettime.h too and
eventually renamed, or are they considered too powerpc specific ?
I don't actually know, my initial interpretation was that
these function names are part of the user ABI for the vdso,
but I never looked closely enough at how vdso works to
be sure what the actual ABI is.
AFAIK the ABI is just the symbols we export, as defined in the linker
script:
/*
* This controls what symbols we export from the DSO.
*/
VERSION
{
VDSO_VERSION_STRING {
global:
__kernel_get_syscall_map;
__kernel_gettimeofday;
__kernel_clock_gettime;
__kernel_clock_getres;
__kernel_get_tbfreq;
__kernel_sync_dicache;
__kernel_sigtramp_rt64;
__kernel_getcpu;
__kernel_time;
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117
quoted
If __c_kernel_clock_gettime() etc are not part of the user-facing
ABI, I think renaming them for consistency with the other
architectures would be best.
The __c symbols are not part of the ABI, so we could rename them.
At the moment though they don't have the same prototype as the generic
versions, because we find the VDSO data in asm and pass it to the C
functions, eg:
int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,
const struct vdso_data *vd);
I think we can rework that though, by implementing
__arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able
to share the prototypes.
Ah thanks. I was wondering why you had done it in asm.
It's a pity but you're right that's probably a measurable performance
hit for some of those calls.
cheers
From: Arnd Bergmann <arnd@arndb.de>
The VDSO functions are defined as globals in the kernel sources but intended
to be called from userspace, so there is no need to declare them in a kernel
side header.
Without a prototype, this now causes warnings such as
arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]
Most architectures have already added workarounds for these by adding
declarations somewhere, but since these are all compatible, we should
really just have one copy, with an #ifdef check for the 32-bit vs
64-bit variant and use that everywhere.
I agree, it is a good idea to have a single header for this purpose.
Unfortunately, the sparc version is currently incompatible since
that never added support for __vdso_clock_gettime64() in 32-bit
userland. For the moment, I'm leaving this one out, as I can't
easily test it and it requires a larger rework.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
@@ -35,9 +33,6 @@ __kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alias("__v#if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64)/* both 64-bit and x32 use these */-externint__vdso_clock_gettime(clockid_tclock,struct__kernel_timespec*ts);-externint__vdso_clock_getres(clockid_tclock,struct__kernel_timespec*res);-int__vdso_clock_gettime(clockid_tclock,struct__kernel_timespec*ts){return__cvdso_clock_gettime(clock,ts);
@@ -56,9 +51,6 @@ int clock_getres(clockid_t, struct __kernel_timespec *)#else/* i386 only */-externint__vdso_clock_gettime(clockid_tclock,structold_timespec32*ts);-externint__vdso_clock_getres(clockid_tclock,structold_timespec32*res);-int__vdso_clock_gettime(clockid_tclock,structold_timespec32*ts){return__cvdso_clock_gettime32(clock,ts);
From: Mark Brown <broonie@kernel.org> Date: 2023-11-24 12:04:50
On Wed, Nov 08, 2023 at 01:58:36PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
The VDSO functions are defined as globals in the kernel sources but intended
to be called from userspace, so there is no need to declare them in a kernel
side header.
This is in -next as commit 42874e4eb35bdfc54f8514685e50434098ba4f6c and
breaks an arm64 defconfig build, the 32 bit vDSO build is broken:
/build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.c:10:5: error: conflic
ting types for ‘__vdso_clock_gettime’; have ‘int(clockid_t, struct old_timespec
32 *)’ {aka ‘int(int, struct old_timespec32 *)’}
10 | int __vdso_clock_gettime(clockid_t clock,
| ^~~~~~~~~~~~~~~~~~~~
In file included from /build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.
c:8:
/build/stage/linux/include/vdso/gettime.h:16:5: note: previous declaration of ‘__vdso_clock_gettime’ with type ‘int(clockid_t, struct __kernel_timespec *)’ {aka ‘int(int, struct __kernel_timespec *)’}
16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
| ^~~~~~~~~~~~~~~~~~~~
/build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.c:28:5: error: conflicting types for ‘__vdso_clock_getres’; have ‘int(clockid_t, struct old_timespec32 *)’ {aka ‘int(int, struct old_timespec32 *)’}
28 | int __vdso_clock_getres(clockid_t clock_id,
| ^~~~~~~~~~~~~~~~~~~
/build/stage/linux/include/vdso/gettime.h:15:5: note: previous declaration of ‘__vdso_clock_getres’ with type ‘int(clockid_t, struct __kernel_timespec *)’ {aka ‘int(int, struct __kernel_timespec *)’}
15 | int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
| ^~~~~~~~~~~~~~~~~~~
From: Arnd Bergmann <arnd@arndb.de>
bch2_target_to_text_sb() is only called in the file it is defined in,
and it has no extern prototype:
fs/bcachefs/disk_groups.c:583:6: error: no previous prototype for 'bch2_target_to_text_sb' [-Werror=missing-prototypes]
Mark it static to avoid the warning and have the code better optimized.
Fixes: bf0d9e89de2e ("bcachefs: Split apart bch2_target_to_text(), bch2_target_to_text_sb()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/bcachefs/disk_groups.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Kent Overstreet <kent.overstreet@linux.dev> Date: 2023-11-08 20:19:48
On Wed, Nov 08, 2023 at 01:58:37PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
bch2_target_to_text_sb() is only called in the file it is defined in,
and it has no extern prototype:
fs/bcachefs/disk_groups.c:583:6: error: no previous prototype for 'bch2_target_to_text_sb' [-Werror=missing-prototypes]
Mark it static to avoid the warning and have the code better optimized.
Fixes: bf0d9e89de2e ("bcachefs: Split apart bch2_target_to_text(), bch2_target_to_text_sb()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Allmodconfig kernels produce a missing-prototypes warning:
arch/powerpc/platforms/ps3/gelic_udbg.c:239:6: error: no previous prototype for 'udbg_shutdown_ps3gelic' [-Werror=missing-prototypes]
Move the declaration from a local header to asm/ps3.h where it can be
seen from both the caller and the definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/include/asm/ps3.h | 6 ++++++
arch/powerpc/platforms/ps3/gelic_udbg.c | 1 +
drivers/net/ethernet/toshiba/ps3_gelic_net.h | 6 ------
3 files changed, 7 insertions(+), 6 deletions(-)
From: Arnd Bergmann <arnd@arndb.de>
Allmodconfig kernels produce a missing-prototypes warning:
arch/powerpc/platforms/ps3/gelic_udbg.c:239:6: error: no previous prototype for 'udbg_shutdown_ps3gelic' [-Werror=missing-prototypes]
Move the declaration from a local header to asm/ps3.h where it can be
seen from both the caller and the definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/include/asm/ps3.h | 6 ++++++
arch/powerpc/platforms/ps3/gelic_udbg.c | 1 +
drivers/net/ethernet/toshiba/ps3_gelic_net.h | 6 ------
3 files changed, 7 insertions(+), 6 deletions(-)
Seems good to me. I'll test it next chance I get.
Signed-off-by: Geoff Levand <geoff@infradead.org>
@@ -64,7 +64,7 @@ static void __noreturn pas_restart(char *cmd)}#ifdef CONFIG_PPC_PASEMI_NEMO-voidpas_shutdown(void)+staticvoidpas_shutdown(void){/* Set the PLD bit that makes the SB600 think the power button is being pressed */void__iomem*pld_map=ioremap(0xf5000000,4096);
From: Arnd Bergmann <arnd@arndb.de>
These functions are only called locally and should be static like the
other corresponding functions are:
arch/powerpc/platforms/powermac/smp.c:416:13: error: no previous prototype for 'smp_psurge_take_timebase' [-Werror=missing-prototypes]
416 | void __init smp_psurge_take_timebase(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/powermac/smp.c:432:13: error: no previous prototype for 'smp_psurge_give_timebase' [-Werror=missing-prototypes]
432 | void __init smp_psurge_give_timebase(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/platforms/powermac/smp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -429,7 +429,7 @@ void __init smp_psurge_take_timebase(void)set_dec(tb_ticks_per_jiffy/2);}-void__initsmp_psurge_give_timebase(void)+staticvoid__initsmp_psurge_give_timebase(void){/* Nothing to do here */}
From: Arnd Bergmann <arnd@arndb.de>
This function is only called locally and should always have been static:
drivers/usb/host/fsl-mph-dr-of.c:291:5: error: no previous prototype for 'fsl_usb2_mpc5121_init' [-Werror=missing-prototypes]
Fixes: 230f7ede6c2f ("USB: add USB EHCI support for MPC5121 SoC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/host/fsl-mph-dr-of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Wed, Nov 08, 2023 at 01:58:41PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
This function is only called locally and should always have been static:
drivers/usb/host/fsl-mph-dr-of.c:291:5: error: no previous prototype for 'fsl_usb2_mpc5121_init' [-Werror=missing-prototypes]
Fixes: 230f7ede6c2f ("USB: add USB EHCI support for MPC5121 SoC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
wr_reg_wa() is not an appropriate name for a global function, and doesn't need
to be global anyway, so mark it static and avoid the warning:
drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes]
Fixes: 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Arnd Bergmann <arnd@arndb.de>
Over the years we went from > 1000 of warnings to under 100 earlier
this year, and I sent patches to address all the ones that I saw with
compile testing randcom configs on arm64, arm and x86 kernels. This is a
really useful warning, as it catches real bugs when there are mismatched
prototypes. In particular with kernel control flow integrity enabled,
those are no longer allowed.
I have done extensive testing to ensure that there are no new build
errors or warnings on any configuration of x86, arm and arm64 builds.
I also made sure that at least the both the normal defconfig and an
allmodconfig build is clean for arc, csky, loongarch, m68k, microblaze,
openrisc, parisc, powerpc, riscv, s390, and xtensa, with the respective
maintainers doing most of the patches.
At this point, there are five architectures with a number of known
regressions: alpha, nios2, mips, sh and sparc. In the previous version
of this patch, I had turned off the missing prototype warnings for the 15
architectures that still had issues, but since there are only five left,
I think we can leave the rest to the maintainers (Cc'd here) as well.
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Ivan Kokshaysky <redacted>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Link: https://lore.kernel.org/lkml/20230810141947.1236730-1-arnd@kernel.org/
Reviewed-by: Kees Cook <redacted>
Acked-by: Palmer Dabbelt <redacted> # RISC-V
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
scripts/Makefile.extrawarn | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Michael Ellerman <hidden> Date: 2023-12-07 12:44:29
On Wed, 08 Nov 2023 13:58:21 +0100, Arnd Bergmann wrote:
I slightly dropped the ball on this since last sending the series in
August, but a number of warning fixes have made it into the kernel in
the meantime, both from my earlier submission and from architecture
maintainers.
I have none patches that remain from the previous submission, with
two of them reworked according to comments. The additional patches
are from more testing across architectures and configurations that
I had previously missed.
[...]