linux-ia64.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Richard Henderson <richard.henderson@linaro.org>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	"David S. Miller" <davem@davemloft.net>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>,
	Qing Zhang <zhangqing@loongson.cn>,
	Donglin Peng <pengdonglin@sangfor.com.cn>,
	Qi Hu <huqi@loongson.cn>,
	linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org,
	loongarch@lists.linux.dev, sparclinux@vger.kernel.org
Subject: Re: [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes
Date: Sat, 12 Aug 2023 07:12:12 +0900	[thread overview]
Message-ID: <CAK7LNARfEmFk0Du4Hed19eX_G6tUC5wG0zP+L1AyvdpOF4ybXQ@mail.gmail.com> (raw)
In-Reply-To: <20230810141947.1236730-16-arnd@kernel.org>

On Sat, Aug 12, 2023 at 3:30 AM Arnd Bergmann <arnd@kernel.org> 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 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

  reply	other threads:[~2023-08-11 22:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 14:19 [PATCH 00/17] -Wmissing-prototype warning fixes Arnd Bergmann
2023-08-10 14:19 ` [PATCH 14/17] kprobes: unify kprobes_exceptions_nofify() prototypes Arnd Bergmann
2023-08-11 11:46   ` Masami Hiramatsu
2023-08-10 14:19 ` [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes Arnd Bergmann
2023-08-11 22:12   ` Masahiro Yamada [this message]
2023-08-12  7:46     ` Arnd Bergmann
2023-08-10 14:19 ` [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally Arnd Bergmann
     [not found]   ` <e0c2f7b1-b137-fbd3-aa28-808498eb8e3f@csgroup.eu>
2023-08-10 15:21     ` Arnd Bergmann
2023-08-10 15:59       ` Helge Deller
2023-08-10 19:15         ` Arnd Bergmann
2023-08-11  2:33   ` Guo Ren
2023-08-11 18:25     ` Vineet Gupta
2023-08-11 20:09   ` Stafford Horne
2023-08-12  8:02     ` Arnd Bergmann
2023-08-16 14:38 ` [PATCH 00/17] -Wmissing-prototype warning fixes Palmer Dabbelt
2023-08-25  1:12 ` (subset) " Martin K. Petersen
2023-08-25  1:30   ` Michael Schmitz
2023-08-25  7:39     ` Geert Uytterhoeven
2023-08-25 22:44       ` Michael Schmitz
2023-08-28  6:42         ` Geert Uytterhoeven
2023-08-28  8:07           ` Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNARfEmFk0Du4Hed19eX_G6tUC5wG0zP+L1AyvdpOF4ybXQ@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=huqi@loongson.cn \
    --cc=ink@jurassic.park.msu.ru \
    --cc=kernel@xen0n.name \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mattst88@gmail.com \
    --cc=pengdonglin@sangfor.com.cn \
    --cc=richard.henderson@linaro.org \
    --cc=rostedt@goodmis.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zhangqing@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).