Re: [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Arnd Bergmann <arnd@xxxxxxxxxx>
- Subject: Re: [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes
- From: Masahiro Yamada <masahiroy@xxxxxxxxxx>
- Date: Sat, 12 Aug 2023 07:12:12 +0900
- Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, WANG Xuerui <kernel@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>, Qing Zhang <zhangqing@xxxxxxxxxxx>, Donglin Peng <pengdonglin@xxxxxxxxxxxxxx>, Qi Hu <huqi@xxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx
- In-reply-to: <20230810141947.1236730-16-arnd@kernel.org>
- References: <20230810141947.1236730-1-arnd@kernel.org> <20230810141947.1236730-16-arnd@kernel.org>
On Sat, Aug 12, 2023 at 3:30 AM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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 we have on other architectures,
> renaming the unused global function to main(), which has an implicit
> prototype.
main() only works for one function call, but
there are some cases where splitting the code
into some functions makes the code cleaner.
> On loongarch, there are many functions in this file, so the trick does
> not work, adding explicit declarations works around it in a slightly
> more ugly way but is the best I could come up with here.
I do not like repeating the function names.
Could you try "static + __used" as in
arch/x86/kernel/asm-offsets.c ?
--
Best Regards
Masahiro Yamada
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]