summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2021-04-10 19:23:57 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-04-14 10:37:04 +0000
commit879ccaa7c581c570dbf86ffcf35239a9d9f19eee (patch)
tree33871fb2ac6cf5d840eafcca91820394aa2be33b /src/include
parent62fa9f3cf940f447e5b103aa31d95ea7dc257bb9 (diff)
downloadcoreboot-879ccaa7c581c570dbf86ffcf35239a9d9f19eee.tar.xz
console: Always add printf-format attribute to printk()
The attribute was missing in case the console is disabled. Change-Id: Iee23f6f4da61cd3637441705a8d3bbd2da7a33ca Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52231 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/console/console.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/console/console.h b/src/include/console/console.h
index d06b5b36fa..fa61e9100a 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -64,7 +64,9 @@ 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 printk(int LEVEL, const char *fmt, ...) {}
+static inline void
+ __attribute__((format(printf, 2, 3)))
+ printk(int LEVEL, const char *fmt, ...) {}
static inline void vprintk(int LEVEL, const char *fmt, va_list args) {}
static inline void do_putchar(unsigned char byte) {}
static inline long console_time_get_and_reset(void) { return 0; }