@@ -311,13 +311,13 @@ static void console_puts_select(int file, bool serial_only, const char *s)
}
}
-void console_puts_select_stderr(bool serial_only, const char *s)
+void err_puts(bool serial_only, const char *s)
{
if (gd->flags & GD_FLG_DEVINIT)
console_puts_select(stderr, serial_only, s);
}
-int console_printf_select_stderr(bool serial_only, const char *fmt, ...)
+int err_printf(bool serial_only, const char *fmt, ...)
{
char buf[CONFIG_SYS_PBSIZE];
va_list args;
@@ -330,7 +330,7 @@ int console_printf_select_stderr(bool serial_only, const char *fmt, ...)
*/
ret = vscnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- console_puts_select_stderr(serial_only, buf);
+ err_puts(serial_only, buf);
return ret;
}
@@ -441,14 +441,12 @@ static int console_truetype_putc_xy(struct udevice *dev, void *vctx, uint x,
last_cp = pos->cp;
kern = stbtt_GetCodepointKernAdvance(font, last_cp, cp);
if (_DEBUG) {
- console_printf_select_stderr(true, "kern %c (%02x)",
- last_cp, last_cp);
+ err_printf(true, "kern %c (%02x)", last_cp, last_cp);
}
xpos += met->scale * kern;
}
if (_DEBUG) {
- console_printf_select_stderr(true, " %c (%02x)\n",
- cp >= ' ' ? cp : ' ', cp);
+ err_printf(true, " %c (%02x)\n", cp >= ' ' ? cp : ' ', cp);
}
/*
@@ -122,7 +122,7 @@ static void vidconsole_newline(struct udevice *dev, struct vidconsole_ctx *ctx)
ret = video_sync(dev->parent, false);
if (ret) {
#ifdef DEBUG
- console_puts_select_stderr(true, "[vc err: video_sync]");
+ err_puts(true, "[vc err: video_sync]");
#endif
}
}
@@ -333,7 +333,7 @@ static void vidconsole_escape_char(struct udevice *dev,
ret = video_sync(dev->parent, false);
if (ret) {
#ifdef DEBUG
- console_puts_select_stderr(true, "[vc err: video_sync]");
+ err_puts(true, "[vc err: video_sync]");
#endif
}
ctx->ycur = 0;
@@ -460,11 +460,10 @@ static int vidconsole_output_glyph(struct udevice *dev,
{
int ret;
- if (_DEBUG) {
- console_printf_select_stderr(true,
- "glyph last_ch '%c': ch '%c' (%02x): ",
- ctx->last_ch, ch >= ' ' ? ch : ' ', ch);
- }
+ if (_DEBUG)
+ err_printf(true, "glyph last_ch '%c': ch '%c' (%02x): ",
+ ctx->last_ch, ch >= ' ' ? ch : ' ', ch);
+
/*
* Failure of this function normally indicates an unsupported
* colour depth. Check this and return an error to help with
@@ -578,13 +577,13 @@ static void vidconsole_putc(struct stdio_dev *sdev, const char ch)
ret = vidconsole_put_char(dev, NULL, ch);
if (ret) {
#ifdef DEBUG
- console_puts_select_stderr(true, "[vc err: putc]");
+ err_puts(true, "[vc err: putc]");
#endif
}
ret = video_sync(dev->parent, false);
if (ret) {
#ifdef DEBUG
- console_puts_select_stderr(true, "[vc err: video_sync]");
+ err_puts(true, "[vc err: video_sync]");
#endif
}
}
@@ -603,13 +602,13 @@ static void vidconsole_putsn(struct stdio_dev *sdev, const char *s, int len)
char str[30];
snprintf(str, sizeof(str), "[vc err: putsn %d]", ret);
- console_puts_select_stderr(true, str);
+ err_puts(true, str);
#endif
}
ret = video_sync(dev->parent, false);
if (ret) {
#ifdef DEBUG
- console_puts_select_stderr(true, "[vc err: video_sync]");
+ err_puts(true, "[vc err: video_sync]");
#endif
}
}
@@ -159,7 +159,7 @@ static inline bool console_record_isempty(void)
int console_announce_r(void);
/**
- * console_puts_select_stderr() - Output a string to selected console devices
+ * err_puts() - Output a string to selected console devices
*
* This writes to stderr only. It is useful for outputting errors
*
@@ -167,10 +167,10 @@ int console_announce_r(void);
* else
* @s: String to output
*/
-void console_puts_select_stderr(bool serial_only, const char *s);
+void err_puts(bool serial_only, const char *s);
/**
- * console_printf_select_stderr() - Output a formatted string to selected devs
+ * err_printf() - Output a formatted string to selected devs
*
* This writes to stderr only. It is useful for outputting errors. Note that it
* uses its own buffer, separate from the print buffer, to allow printing
@@ -181,7 +181,7 @@ void console_puts_select_stderr(bool serial_only, const char *s);
* @fmt: Printf format string, followed by format arguments
* Return: number of characters written
*/
-int console_printf_select_stderr(bool serial_only, const char *fmt, ...)
+int err_printf(bool serial_only, const char *fmt, ...)
__attribute__ ((format (__printf__, 2, 3)));
/**