mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] include: move panic() prototype to <printk.h>
@ 2022-09-30 15:42 Ahmad Fatoum
  2022-09-30 15:42 ` [PATCH 2/2] relocate_to_current_adr: hang directly on error instead of panic() Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2022-09-30 15:42 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The panic declaration in <linux/kernel.h> is out of place and unexpected
as it's not a Linux kernel. printf() and printk() are defined in
<printk.h>, so move it there too. Most files making use of panic(), pull
it in via <common.h>, so we only need to adjust two headers for the
new location.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/cpu/mmu-common.h | 1 +
 include/firmware.h        | 1 +
 include/linux/kernel.h    | 2 --
 include/printk.h          | 2 ++
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/mmu-common.h b/arch/arm/cpu/mmu-common.h
index c9ea2c122857..7a69122ee6fa 100644
--- a/arch/arm/cpu/mmu-common.h
+++ b/arch/arm/cpu/mmu-common.h
@@ -3,6 +3,7 @@
 #ifndef __ARM_MMU_COMMON_H
 #define __ARM_MMU_COMMON_H
 
+#include <printk.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
diff --git a/include/firmware.h b/include/firmware.h
index 2cfaeb1e6a91..cfb88993222a 100644
--- a/include/firmware.h
+++ b/include/firmware.h
@@ -7,6 +7,7 @@
 #define FIRMWARE_H
 
 #include <pbl.h>
+#include <printk.h>
 #include <types.h>
 #include <driver.h>
 #include <debug_ll.h>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4483d33e65bb..44fc02df0bf9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -82,8 +82,6 @@
 		(__x < 0) ? -__x : __x;         \
 	})
 
-void __noreturn panic(const char *fmt, ...);
-
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
 extern long simple_strtol(const char *,char **,unsigned int);
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
diff --git a/include/printk.h b/include/printk.h
index 8de8202af97c..b313b408a97b 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -27,6 +27,8 @@ static inline int printf(const char *fmt, ...)
 }
 #endif
 
+void __attribute__((noreturn)) panic(const char *fmt, ...);
+
 #define printk			printf
 
 #define printk_once(fmt, ...)					\
-- 
2.30.2




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

end of thread, other threads:[~2022-10-05  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30 15:42 [PATCH 1/2] include: move panic() prototype to <printk.h> Ahmad Fatoum
2022-09-30 15:42 ` [PATCH 2/2] relocate_to_current_adr: hang directly on error instead of panic() Ahmad Fatoum
2022-10-05  6:30   ` Sascha Hauer

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