From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jiangshan Yi <yijiangshan@kylinos.cn>,
Kees Cook <keescook@chromium.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Randy Dunlap <rdunlap@infradead.org>,
Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH] linux/init.h: include <linux/build_bug.h> and <linux/stringify.h>
Date: Sun, 13 Nov 2022 20:08:02 +0900 [thread overview]
Message-ID: <20221113110802.3760705-1-masahiroy@kernel.org> (raw)
With CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y, the following code
fails to build:
---------------->8----------------
#include <linux/init.h>
int foo(void) { return 0; }
core_initcall(foo);
---------------->8----------------
Include <linux/build_bug.h> for static_assert() and <linux/stringify.h>
for __stringify().
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
include/linux/init.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/init.h b/include/linux/init.h
index 077d7f93b402..29f7157670a5 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -2,7 +2,9 @@
#ifndef _LINUX_INIT_H
#define _LINUX_INIT_H
+#include <linux/build_bug.h>
#include <linux/compiler.h>
+#include <linux/stringify.h>
#include <linux/types.h>
/* Built-in __init functions needn't be compiled with retpoline */
--
2.34.1
reply other threads:[~2022-11-13 11:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221113110802.3760705-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=samitolvanen@google.com \
--cc=yijiangshan@kylinos.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