]> git.dujemihanovic.xyz Git - u-boot.git/commit
bootflow: Rework do_bootflow_menu() slightly
authorTom Rini <trini@konsulko.com>
Thu, 6 Apr 2023 14:03:33 +0000 (10:03 -0400)
committerSimon Glass <sjg@chromium.org>
Fri, 28 Apr 2023 17:30:17 +0000 (11:30 -0600)
commite0dda26c2e9fb4150a5ab0b8b5ad58da5dd355cd
tree1a3bfd219caae4e733584a9681cefc3a6685087a
parent86592af5369ae14fb3b273479beb430d7e88de10
bootflow: Rework do_bootflow_menu() slightly

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@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/bootflow.c