]> www.infradead.org Git - users/hch/configfs.git/commitdiff
linux/init.h: include <linux/build_bug.h> and <linux/stringify.h>
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 13 Nov 2022 11:08:02 +0000 (20:08 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 1 Dec 2022 00:13:18 +0000 (16:13 -0800)
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().

Link: https://lkml.kernel.org/r/20221113110802.3760705-1-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Jiangshan Yi <yijiangshan@kylinos.cn>
Cc: Kees Cook <keescook@chromium.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Randy Dunlap <rdunlap@infradead.org> # build-tested
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/init.h

index 2e96756fe1ff223aee19465d068a133bbdb24b88..c5fe6d26f5b150b7bd941d7667d84174ecfbbbd7 100644 (file)
@@ -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 */