From 7cc14ac25d9d40a7c2fc078c248faafbac887a5d Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 27 Mar 2021 20:03:02 +0100 Subject: Rename do_printk() to printk() The indirection seems unnecessary. The macros throw features like `-Wmisleading-indentation` off, though. Default build for QEMU/Q35 is unchanged. Change-Id: Ie4eab935a367b5ad6b38225c4973d41d9f70ef10 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/51887 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/include/console/console.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/include/console') diff --git a/src/include/console/console.h b/src/include/console/console.h index fa61e9100a5a..17448fe768a1 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -50,6 +50,10 @@ static inline int get_console_loglevel(void) #if __CONSOLE_ENABLE__ asmlinkage void console_init(void); int console_log_level(int msg_level); + +int printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); +int vprintk(int msg_level, const char *fmt, va_list args); + void do_putchar(unsigned char byte); /* Return number of microseconds elapsed from start of stage or the previous @@ -57,25 +61,17 @@ void do_putchar(unsigned char byte); long console_time_get_and_reset(void); void console_time_report(void); -#define printk(LEVEL, fmt, args...) do_printk(LEVEL, fmt, ##args) -#define vprintk(LEVEL, fmt, args) do_vprintk(LEVEL, fmt, args) - enum { CONSOLE_LOG_NONE = 0, CONSOLE_LOG_FAST, CONSOLE_LOG_ALL }; #else static inline void console_init(void) {} static inline int console_log_level(int msg_level) { return 0; } -static inline void +static inline int __attribute__((format(printf, 2, 3))) - printk(int LEVEL, const char *fmt, ...) {} -static inline void vprintk(int LEVEL, const char *fmt, va_list args) {} + printk(int LEVEL, const char *fmt, ...) { return 0; } +static inline int vprintk(int LEVEL, const char *fmt, va_list args) { return 0; } static inline void do_putchar(unsigned char byte) {} static inline long console_time_get_and_reset(void) { return 0; } static inline void console_time_report(void) {} #endif -int do_printk(int msg_level, const char *fmt, ...) - __attribute__((format(printf, 2, 3))); - -int do_vprintk(int msg_level, const char *fmt, va_list args); - #endif /* CONSOLE_CONSOLE_H_ */ -- cgit v1.2.3