[PATCH 3/5] env: make env_set_default_vars() return void

Wolfgang Denk wd at denx.de
Thu Nov 12 20:51:08 CET 2020


Dear Rasmus,

In message <20201110202603.20944-4-rasmus.villemoes at prevas.dk> you wrote:
> Unlike most other functions declared in env.h, the return value of
> this one also isn't documented. It only has a single caller, which
> ignores the return value. And the companion, env_set_default(),
> already has void as return type.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>

Naked-by: Wolfgang Denk <wd at denx.de>

This is not a good idea.  himport_r() can run into problems, and
then it returns an error code. Ignoring errors is never correct.

Instead, the caller should be fixed to add proper error handling.

env_set_default() at least prints a proper error message.

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
Don't have a battle of wits with an unarmed opponent.


More information about the U-Boot mailing list