mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] printf: define printk/no_printk in terms of prints
@ 2025-11-28 12:50 Ahmad Fatoum
  2025-11-28 12:50 ` [PATCH 2/4] bug: add support for CONFIG_DEBUG_BUGVERBOSE Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2025-11-28 12:50 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We will later move printk into its own header while giving it more
Linux-like semantics. Prepare for that by defining no_printf, so users
across the tree can make use of it without including <linux/printk.h>.

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

diff --git a/include/printf.h b/include/printf.h
index d111afacb63e..58793bc067dc 100644
--- a/include/printf.h
+++ b/include/printf.h
@@ -30,19 +30,20 @@ static inline __printf(1, 2) int printf(const char *fmt, ...)
 void __noreturn panic(const char *fmt, ...) __printf(1, 2);
 void __noreturn panic_no_stacktrace(const char *fmt, ...) __printf(1, 2);
 
-#define printk			printf
-
 /*
- * Dummy printk for disabled debugging statements to use whilst maintaining
+ * Dummy printf for disabled debugging statements to use whilst maintaining
  * gcc's format checking.
  */
-#define no_printk(fmt, ...)				\
+#define no_printf(fmt, ...)				\
 ({							\
 	if (0)						\
 		printk(fmt, ##__VA_ARGS__);		\
 	0;						\
 })
 
+#define printk			printf
+#define no_printk		no_printf
+
 enum {
 	DUMP_PREFIX_NONE,
 	DUMP_PREFIX_ADDRESS,
-- 
2.47.3




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

end of thread, other threads:[~2025-12-01 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-28 12:50 [PATCH 1/4] printf: define printk/no_printk in terms of prints Ahmad Fatoum
2025-11-28 12:50 ` [PATCH 2/4] bug: add support for CONFIG_DEBUG_BUGVERBOSE Ahmad Fatoum
2025-11-28 12:50 ` [PATCH 3/4] include: move sprintf prototypes to new linux/sprintf.h Ahmad Fatoum
2025-11-28 12:50 ` [PATCH 4/4] console: move non-stdio elements to console.h Ahmad Fatoum
2025-12-01 10:22 ` [PATCH 1/4] printf: define printk/no_printk in terms of prints Sascha Hauer

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