[PATCH 1/4] init: mark initcalls const

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jul 16 04:57:08 PDT 2024


The initcalls shouldn't be modified at runtime and they are part of the
BAREBOX_RO_SECTION, so mark them const accordingly.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/init.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/init.h b/include/init.h
index 33a76974f23d..7061f911a888 100644
--- a/include/init.h
+++ b/include/init.h
@@ -36,10 +36,10 @@ typedef void (*exitcall_t)(void);
 #ifndef __ASSEMBLY__
 
 #define __define_initcall(fn,id) \
-	static initcall_t __initcall_##fn##id __ll_elem(.initcall.##id) = fn
+	static const initcall_t __initcall_##fn##id __ll_elem(.initcall.##id) = fn
 
 #define __define_exitcall(fn,id) \
-	static exitcall_t __exitcall_##fn##id __ll_elem(.exitcall.##id) = fn
+	static const exitcall_t __exitcall_##fn##id __ll_elem(.exitcall.##id) = fn
 
 
 /*
-- 
2.39.2




More information about the barebox mailing list