From 531c74af49d70b7079488988fa0d11274b4bd599 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sat, 30 Oct 2021 16:17:38 +0200 Subject: include: : make self-contained so far depended on a preceding to get the dump_stack() definition. Move dump_stack() to the new printk.h and drop the remaining puts() use to make header self-contained. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20211030141739.2207431-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- include/asm-generic/bug.h | 5 +++-- include/common.h | 9 --------- include/printk.h | 10 ++++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 82b78261fc..6aa3eada0e 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -2,6 +2,8 @@ #define _ASM_GENERIC_BUG_H #include +#include +#include #define BUG() do { \ printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ @@ -28,8 +30,7 @@ int __ret_warn_on = !!(condition); \ if (unlikely(__ret_warn_on)) { \ __WARN(); \ - puts("WARNING: "); \ - printf(format); \ + printf("WARNING: " format); \ } \ unlikely(__ret_warn_on); \ }) diff --git a/include/common.h b/include/common.h index 083b76cfed..e37630243e 100644 --- a/include/common.h +++ b/include/common.h @@ -62,15 +62,6 @@ void ctrlc_handled(void); static inline void ctrlc_handled(void) { } #endif -#ifdef CONFIG_ARCH_HAS_STACK_DUMP -void dump_stack(void); -#else -static inline void dump_stack(void) -{ - printf("no stack data available\n"); -} -#endif - int parse_area_spec(const char *str, loff_t *start, loff_t *size); /* Just like simple_strtoul(), but this one honors a K/M/G suffix */ diff --git a/include/printk.h b/include/printk.h index 0915efbadd..baf2cca202 100644 --- a/include/printk.h +++ b/include/printk.h @@ -47,4 +47,14 @@ extern void print_hex_dump(const char *level, const char *prefix_str, int prefix_type, int rowsize, int groupsize, const void *buf, size_t len, bool ascii); +#ifdef CONFIG_ARCH_HAS_STACK_DUMP +void dump_stack(void); +#else +static inline void dump_stack(void) +{ + printf("no stack data available\n"); +} +#endif + + #endif -- cgit v1.2.3