diff mbox series

[1/2] spl: Avoid printing boot device if silent console is enabled

Message ID 20200929231414.1.If4f1e6e03b7f0444b40d56e0cb624b863f0b4dc5@changeid
State Deferred
Delegated to: Tom Rini
Headers show
Series [1/2] spl: Avoid printing boot device if silent console is enabled | expand

Commit Message

Otavio Salvador Sept. 30, 2020, 2:14 a.m. UTC
This avoid emitting message if silent console is in use, otherwise it
pollutes the output and user desires a quiet console

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---

 common/spl/spl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Roese Sept. 30, 2020, 5:23 a.m. UTC | #1
Hi Otavio,

On 30.09.20 04:14, Otavio Salvador wrote:
> This avoid emitting message if silent console is in use, otherwise it
> pollutes the output and user desires a quiet console
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> 
>   common/spl/spl.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 4840d1d3670..63c48fbf33d 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -552,7 +552,9 @@ static int boot_from_devices(struct spl_image_info *spl_image,
>   		struct spl_image_loader *loader;
>   
>   		loader = spl_ll_find_loader(spl_boot_list[i]);
> -#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> +#if defined(CONFIG_SPL_SERIAL_SUPPORT) \
> +    && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)    \
> +    && !defined(CONFIG_SILENT_CONSOLE)
>   		if (loader)
>   			printf("Trying to boot from %s\n", loader->name);
>   		else
> 

Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
the console / printf function itself instead of adding it to all
callers?

Thanks,
Stefan
Otavio Salvador Sept. 30, 2020, 11:47 a.m. UTC | #2
Em qua., 30 de set. de 2020 às 02:23, Stefan Roese <sr@denx.de> escreveu:
> On 30.09.20 04:14, Otavio Salvador wrote:
> Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
> the console / printf function itself instead of adding it to all
> callers?

I believe in critical errors and like, it is important to print so I'd
say that using a more controlled "hide" mechanism is good.
Stefan Roese Oct. 1, 2020, 12:50 p.m. UTC | #3
On 30.09.20 13:47, Otavio Salvador wrote:
> Em qua., 30 de set. de 2020 às 02:23, Stefan Roese <sr@denx.de> escreveu:
>> On 30.09.20 04:14, Otavio Salvador wrote:
>> Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
>> the console / printf function itself instead of adding it to all
>> callers?
> 
> I believe in critical errors and like, it is important to print so I'd
> say that using a more controlled "hide" mechanism is good.

Agreed. I forgot about that.

Thanks,
Stefan
diff mbox series

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4840d1d3670..63c48fbf33d 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -552,7 +552,9 @@  static int boot_from_devices(struct spl_image_info *spl_image,
 		struct spl_image_loader *loader;
 
 		loader = spl_ll_find_loader(spl_boot_list[i]);
-#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if defined(CONFIG_SPL_SERIAL_SUPPORT) \
+    && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)    \
+    && !defined(CONFIG_SILENT_CONSOLE)
 		if (loader)
 			printf("Trying to boot from %s\n", loader->name);
 		else