Skip to contentSkip to conversation

linux/init.h: include <linux/build_bug.h> and <linux/stringify.h>

PATCH Applied Masahiro Yamada 1 participant 1 message Nov 13, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/init.h: include <linux/build_bug.h> and <linux/stringify.h>

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().

---

 include/linux/init.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/init.h +2 -0
index 077d7f93b402..29f7157670a5 100644
@@ -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 */
Signature · 1 line
2.34.1