# \[PATCH v1 2/3\] powerpc: Stop using init\_mem\_is\_free

- From: Christophe Leroy \<hidden\>
- Date: 2021-09-24 12:38:43 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/09/1520618
- Thread: https://ratatoskr.run/linuxppc-dev/2021/09/1520616/t.md

```text
Generic parts of the kernel for instance core_kernel_text()
use 'system_state' to check whether init memory has been
freed.

Do the same and stop using init_mem_is_free.

Cc: Michael Neuling <redacted>
Signed-off-by: Christophe Leroy <redacted>
---
 arch/powerpc/include/asm/sections.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
index 6e4af4492a14..dff55421f76b 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -14,7 +14,7 @@ extern bool init_mem_is_free;
 
 static inline int arch_is_kernel_initmem_freed(unsigned long addr)
 {
-	if (!init_mem_is_free)
+	if (system_state < SYSTEM_RUNNING)
 		return 0;
 
 	return addr >= (unsigned long)__init_begin &&
-- 
2.31.1

```
