[PATCH] bootflow: Rework do_bootflow_menu() slightly

Simon Glass sjg at chromium.org
Sat Apr 22 18:51:26 CEST 2023


On Fri, 7 Apr 2023 at 02:03, Tom Rini <trini at konsulko.com> wrote:
>
> When building this with clang, we get a warning such as:
> cmd/bootflow.c:412:27: warning: variable 'bflow' is uninitialized when used here [-Wuninitialized]
>         printf("Selected: %s\n", bflow->os_name ? bflow->os_name : bflow->name);
>                                  ^~~~~
>
> And a suggestion to just initialize bflow to NULL. This would however
> would be ensuring a bad dereference. Instead, looking at the function we
> rework things so that when CONFIG_EXPO is not enabled (and so, no UI) we
> error early and would never reach this point in the code.  Simplify the
> rest slightly as well while at this.
>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> Cc: Simon Glass <sjg at chromium.org>
> ---
>  cmd/bootflow.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list