Skip to contentSkip to conversation

arm64: mm: ptdump: Add __init section marker to three functions

PATCH Superseded Jisheng Zhang 1 participant 1 message Mar 30, 2021 arm64

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mm: ptdump: Add __init section marker to three functions

They are not needed after booting, so mark them as __init to move them to the .init section.

---
 arch/arm64/include/asm/ptdump.h | 2 +-
 arch/arm64/mm/ptdump.c          | 4 ++--
 arch/arm64/mm/ptdump_debugfs.c  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/include/asm/ptdump.h +1 -1
index 38187f74e089..b1dd7ecff7ef 100644
@@ -23,7 +23,7 @@ struct ptdump_info {
 
 void ptdump_walk(struct seq_file *s, struct ptdump_info *info);
 #ifdef CONFIG_PTDUMP_DEBUGFS
-void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
+void __init ptdump_debugfs_register(struct ptdump_info *info, const char *name);
 #else
 static inline void ptdump_debugfs_register(struct ptdump_info *info,
 					   const char *name) { }
arch/arm64/mm/ptdump.c +2 -2
index 0e050d76b83a..a50e92ea1878 100644
@@ -337,7 +337,7 @@ void ptdump_walk(struct seq_file *s, struct ptdump_info *info)
 	ptdump_walk_pgd(&st.ptdump, info->mm, NULL);
 }
 
-static void ptdump_initialize(void)
+static void __init ptdump_initialize(void)
 {
 	unsigned i, j;
 
@@ -381,7 +381,7 @@ void ptdump_check_wx(void)
 		pr_info("Checked W+X mappings: passed, no W+X pages found\n");
 }
 
-static int ptdump_init(void)
+static int __init ptdump_init(void)
 {
 	address_markers[PAGE_END_NR].start_address = PAGE_END;
 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
arch/arm64/mm/ptdump_debugfs.c +1 -1
index d29d722ec3ec..68bf1a125502 100644
@@ -16,7 +16,7 @@ static int ptdump_show(struct seq_file *m, void *v)
 }
 DEFINE_SHOW_ATTRIBUTE(ptdump);
 
-void ptdump_debugfs_register(struct ptdump_info *info, const char *name)
+void __init ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
 	debugfs_create_file(name, 0400, NULL, info, &ptdump_fops);
 }
Signature · 1 line
2.31.0