summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-07-06 19:05:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-09 12:32:59 +0300
commitab8c357dbf879ab91703b0ec292176664d5d6d4b (patch)
tree6b5c01f7febeb2a5a4aff16ae76ebf655bd90629 /include/linux
parent52197a7c14df5597fefae3aeae590761679a6b6d (diff)
downloadlinux-ab8c357dbf879ab91703b0ec292176664d5d6d4b.tar.xz
init/modpost: conditionally check section mismatch to __meminit*
[ Upstream commit 73db3abdca58c8a014ec4c88cf5ef925cbf63669 ] This reverts commit eb8f689046b8 ("Use separate sections for __dev/ _cpu/__mem code/data"). Check section mismatch to __meminit* only when CONFIG_MEMORY_HOTPLUG=n. With this change, the linker script and modpost become simpler, and we can get rid of the __ref annotations from the memory hotplug code. [sfr@canb.auug.org.au: remove MEM_KEEP from arch/powerpc/kernel/vmlinux.lds.S] Link: https://lkml.kernel.org/r/20240710093213.2aefb25f@canb.auug.org.au Link: https://lkml.kernel.org/r/20240706160511.2331061-2-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Reviewed-by: Wei Yang <richard.weiyang@gmail.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/init.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index 01b52c9c7526..63d2ee4f1f0e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -84,11 +84,15 @@
#define __exit __section(".exit.text") __exitused __cold notrace
-/* Used for MEMORY_HOTPLUG */
-#define __meminit __section(".meminit.text") __cold notrace \
- __latent_entropy
-#define __meminitdata __section(".meminit.data")
-#define __meminitconst __section(".meminit.rodata")
+#ifdef CONFIG_MEMORY_HOTPLUG
+#define __meminit
+#define __meminitdata
+#define __meminitconst
+#else
+#define __meminit __init
+#define __meminitdata __initdata
+#define __meminitconst __initconst
+#endif
/* For assembly routines */
#define __HEAD .section ".head.text","ax"