mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] pbl: console: fix undefined reference to vprintf()
Date: Wed,  4 Mar 2026 11:49:04 +0100	[thread overview]
Message-ID: <20260304104904.1205995-1-s.hauer@pengutronix.de> (raw)

panic() now uses vprintf() which is not available without
CONFIG_PBL_CONSOLE. Move the declaration to the right ifdeffery
which already handles that case.

Fixes: 33e3bc4782 ("pbl: fix panic() message printing")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/stdio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h
index 945ec46926..4c0dff0c00 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -12,10 +12,8 @@
 /* stdin */
 int tstc(void);
 int getchar(void);
-int vprintf(const char *fmt, va_list args);
 #else
 static inline int tstc(void) { return 0; }
-static inline int vprintf(const char *fmt, va_list args) { return 0; }
 static inline int getchar(void) { return -EINVAL; }
 #endif
 
@@ -23,11 +21,13 @@ int readline(const char *prompt, char *buf, int len);
 
 #if (IN_PROPER && !defined(CONFIG_CONSOLE_NONE)) || \
 	(IN_PBL && defined(CONFIG_PBL_CONSOLE))
+int vprintf(const char *fmt, va_list args);
 static inline int puts(const char *s) { return console_puts(CONSOLE_STDOUT, s); }
 static inline void putchar(char c) { console_putc(CONSOLE_STDOUT, c); }
 #else
 static inline int puts(const char *s) { return 0; }
 static inline void putchar(char c) {}
+static inline int vprintf(const char *fmt, va_list args) { return 0; }
 #endif
 
 int readline(const char *prompt, char *buf, int len);
-- 
2.47.3




             reply	other threads:[~2026-03-04 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 10:49 Sascha Hauer [this message]
2026-03-05  6:39 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260304104904.1205995-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox