summaryrefslogtreecommitdiffstats
path: root/src/include/console
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2021-03-27 20:03:02 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-04-14 10:38:09 +0000
commit7cc14ac25d9d40a7c2fc078c248faafbac887a5d (patch)
treefafe642d5fa78acd01388f77d169af1f9e647ab6 /src/include/console
parent879ccaa7c581c570dbf86ffcf35239a9d9f19eee (diff)
downloadcoreboot-7cc14ac25d9d40a7c2fc078c248faafbac887a5d.tar.gz
coreboot-7cc14ac25d9d40a7c2fc078c248faafbac887a5d.tar.bz2
coreboot-7cc14ac25d9d40a7c2fc078c248faafbac887a5d.zip
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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51887 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/console.h18
1 files changed, 7 insertions, 11 deletions
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_ */