From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Bin Meng <bmeng@tinylab.org>
Cc: "Harald Seiler" <hws@denx.de>,
"Marek Vasut" <marek.vasut+renesas@mailbox.org>,
"Pali Rohár" <pali@kernel.org>,
"Rasmus Villemoes" <rasmus.villemoes@prevas.dk>,
"Stefan Roese" <sr@denx.de>,
u-boot@lists.denx.de, "Simon Glass" <sjg@chromium.org>
Subject: Re: [PATCH 13/18] console: Refactor stdio_print_current_devices() a little bit
Date: Sun, 23 Jul 2023 08:39:34 +0200 [thread overview]
Message-ID: <0f50cd31-e2a3-d69e-d583-002b652bb2d6@gmx.de> (raw)
In-Reply-To: <20230723044041.1089804-14-bmeng@tinylab.org>
On 7/23/23 06:40, Bin Meng wrote:
> In preparation to future changes, refactor this routine a little bit.
>
> Signed-off-by: Bin Meng <bmeng@tinylab.org>
> ---
>
> common/console.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/common/console.c b/common/console.c
> index d0640ba05a..af52897ec3 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -1012,27 +1012,27 @@ int console_init_f(void)
>
> static void stdio_print_current_devices(void)
> {
> + char *stdinname, *stdoutname, *stderrname;
> +
> + stdinname = stdio_devices[stdin] ?
> + stdio_devices[stdin]->name :
> + "No input devices available!";
> + stdoutname = stdio_devices[stdout] ?
> + stdio_devices[stdout]->name :
> + "No output devices available!";
This string will never be printed as you have no output device.
Best regards
Heinrich
> + stderrname = stdio_devices[stderr] ?
> + stdio_devices[stderr]->name :
> + "No error devices available!";
> +
> /* Print information */
> puts("In: ");
> - if (stdio_devices[stdin] == NULL) {
> - puts("No input devices available!\n");
> - } else {
> - printf ("%s\n", stdio_devices[stdin]->name);
> - }
> + printf("%s\n", stdinname);
>
> puts("Out: ");
> - if (stdio_devices[stdout] == NULL) {
> - puts("No output devices available!\n");
> - } else {
> - printf ("%s\n", stdio_devices[stdout]->name);
> - }
> + printf("%s\n", stdoutname);
>
> puts("Err: ");
> - if (stdio_devices[stderr] == NULL) {
> - puts("No error devices available!\n");
> - } else {
> - printf ("%s\n", stdio_devices[stderr]->name);
> - }
> + printf("%s\n", stderrname);
> }
>
> #if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
next prev parent reply other threads:[~2023-07-23 6:39 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-23 4:40 [PATCH 00/18] video: bochs: Remove the x86 limitation Bin Meng
2023-07-23 4:40 ` [PATCH 01/18] dm: video: Cosmetic style fix Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 12:57 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 02/18] video: bochs: Drop inclusion of <asm/mtrr.h> Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 12:58 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 03/18] video: bochs: Drop the useless argument of bochs_vga_write() Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 12:59 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 04/18] video: bochs: Avoid using IO instructions to access VGA IO port Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 12:59 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 05/18] video: bochs: Remove the x86 dependency Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 13:00 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 06/18] video: kconfig: Fix wrong text for the PCI default FB size Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 13:00 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 07/18] video: kconfig: Drop the superfluous dependency Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 13:00 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 08/18] video: kconfig: Set default FB size for Bochs Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 13:01 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 09/18] video: bochs: Set the frame buffer size per configuration Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-08-01 13:01 ` Anatolij Gustschin
2023-07-23 4:40 ` [PATCH 10/18] riscv: qemu: Enable Bochs video support Bin Meng
2023-07-27 0:50 ` Simon Glass
2023-07-23 4:40 ` [PATCH 11/18] console: kconfig: Drop the redundant VIDEO dependency Bin Meng
2023-07-23 6:40 ` Heinrich Schuchardt
2023-07-23 22:58 ` Simon Glass
2023-07-23 4:40 ` [PATCH 12/18] console: Make stdio_print_current_devices() static Bin Meng
2023-07-23 22:58 ` Simon Glass
2023-07-23 4:40 ` [PATCH 13/18] console: Refactor stdio_print_current_devices() a little bit Bin Meng
2023-07-23 6:39 ` Heinrich Schuchardt [this message]
2023-07-23 4:40 ` [PATCH 14/18] console: Print out complete stdio device list Bin Meng
2023-07-23 6:38 ` Heinrich Schuchardt
2023-07-23 12:04 ` Bin Meng
2023-07-23 12:47 ` Heinrich Schuchardt
2023-07-23 14:16 ` Bin Meng
2023-07-24 2:08 ` Simon Glass
2023-07-24 18:02 ` Tom Rini
2023-07-23 4:40 ` [PATCH 15/18] riscv: qemu: Enable PRE_CONSOLE_BUFFER Bin Meng
[not found] ` <SEZPR03MB806449404CFF3CB65A435E52C103A@SEZPR03MB8064.apcprd03.prod.outlook.com>
2023-07-25 7:20 ` Rick Chen
2023-07-27 0:50 ` Simon Glass
2023-07-23 4:40 ` [PATCH 16/18] riscv: define a cache line size for the generic CPU Bin Meng
2023-07-23 4:40 ` [PATCH 17/18] riscv: qemu: Remove out-of-date "riscv, kernel-start" handling Bin Meng
[not found] ` <SEZPR03MB80646AC3947DBFA62D910A47C103A@SEZPR03MB8064.apcprd03.prod.outlook.com>
2023-07-25 7:17 ` Rick Chen
2023-07-27 0:50 ` Simon Glass
2023-07-23 4:40 ` [PATCH 18/18] riscv: qemu: Enable usb keyboard as an input device Bin Meng
2023-07-23 6:11 ` Heinrich Schuchardt
2023-07-23 12:01 ` Bin Meng
2023-07-23 8:38 ` Mark Kettenis
2023-07-23 9:30 ` Heinrich Schuchardt
2023-07-23 10:11 ` Mark Kettenis
2023-07-24 18:11 ` Heinrich Schuchardt
[not found] ` <SEZPR03MB80643451FB26D109D4606A90C103A@SEZPR03MB8064.apcprd03.prod.outlook.com>
2023-07-25 7:05 ` Rick Chen
2023-07-27 0:50 ` Simon Glass
2023-07-25 4:10 ` [PATCH 00/18] video: bochs: Remove the x86 limitation Bin Meng
2023-07-31 5:26 ` Bin Meng
2023-08-01 13:03 ` Anatolij Gustschin
2023-08-01 13:43 ` Bin Meng
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=0f50cd31-e2a3-d69e-d583-002b652bb2d6@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=bmeng@tinylab.org \
--cc=hws@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=pali@kernel.org \
--cc=rasmus.villemoes@prevas.dk \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/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