From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] include: move panic() prototype to <printk.h>
Date: Fri, 30 Sep 2022 17:42:46 +0200 [thread overview]
Message-ID: <20220930154247.756577-1-a.fatoum@pengutronix.de> (raw)
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
next reply other threads:[~2022-09-30 15:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 15:42 Ahmad Fatoum [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220930154247.756577-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox