mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] init: mark initcalls const
@ 2024-07-16 11:57 Ahmad Fatoum
  2024-07-16 11:57 ` [PATCH 2/4] base: use initcalls instead of linker lists to register classes Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2024-07-16 11:57 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-19  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-16 11:57 [PATCH 1/4] init: mark initcalls const Ahmad Fatoum
2024-07-16 11:57 ` [PATCH 2/4] base: use initcalls instead of linker lists to register classes Ahmad Fatoum
2024-07-16 11:57 ` [PATCH 3/4] watchdog: remove needless error checking for device parameter Ahmad Fatoum
2024-07-16 11:57 ` [PATCH 4/4] watchdog: factor out device registration into common class code Ahmad Fatoum
2024-07-19  6:26 ` [PATCH 1/4] init: mark initcalls const Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox