Thread (46 messages) 46 messages, 17 authors, 2024-01-10

Re: [PATCH 09/22] [v2] arch: fix asm-offsets.c building with -Wmissing-prototypes

From: Sam Ravnborg <hidden>
Date: 2023-11-08 19:12:04
Also in: dri-devel, linux-alpha, linux-bcachefs, linux-fbdev, linux-kbuild, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, linux-usb, linuxppc-dev, lkml, loongarch, netdev, sparclinux

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/ (local)
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help