[Patch v2 2/6] x86/mm: Add attribute __ro_after_init to after_bootmem

From: Wei Yang
Date: Wed Dec 04 2019 - 21:15:50 EST


after_bootmem is only set in mem_init().

Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx>
---
arch/x86/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 916a3d9b5bfd..4fa5fd641865 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -160,7 +160,7 @@ void __init early_alloc_pgt_buf(void)
pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT);
}

-int after_bootmem;
+int after_bootmem __ro_after_init;

early_param_on_off("gbpages", "nogbpages", direct_gbpages, CONFIG_X86_DIRECT_GBPAGES);

--
2.17.1