[U-Boot] [RFC 2/2] env: Add prefix to error messages when loading env

Wolfgang Denk wd at denx.de
Wed Jul 18 06:23:08 UTC 2018


Dear Sam,

In message <20180717220912.11358-2-semen.protsenko at linaro.org> you wrote:
> This is just a draft to discuss ideas related to "Make U-Boot log great
> again" thread.
> 
> With this patch we will see something like:
> 
>     Loading Environment from FAT...
>        --> MMC: no card present
>        --> ** Bad device mmc 0 **
>        --> Failed (-5)

This may be ok in the error case, but...

>     Loading Environment from MMC...
>        --> OK

it is definitely really ugly in the normal, non-error case.

NAK.

>  void puts(const char *s)
>  {
> +	if (gd->pr_prefix) {
> +		const char *prefix = gd->pr_prefix;
> +
> +		gd->pr_prefix = NULL;
> +		puts(prefix);
> +		gd->pr_prefix = prefix;
> +	}
> +

Besides - global data is a precious resource on may systems,
sometimes limited to very few kB of memory.  It should be only used
to the extend where it really cannot be avoided, but not for any
such "beautifying" stuff.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are no data that cannot be plotted on a straight  line  if  the
axis are chosen correctly.


More information about the U-Boot mailing list