]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
boot: Improve comments related to global bootmeths
authorSimon Glass <sjg@chromium.org>
Sun, 12 Oct 2025 06:43:53 +0000 (00:43 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 14 Oct 2025 22:12:50 +0000 (16:12 -0600)
Add a few comments about global bootmeths and first_glob_method

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
boot/bootflow.c
boot/bootmeth-uclass.c
include/bootflow.h
test/boot/bootflow.c

index d79f303486df788df10ceb15bb3e0944ccb79c32..15df70692091f656ae58661ea050fc939b14a19c 100644 (file)
@@ -344,6 +344,7 @@ static int bootflow_check(struct bootflow_iter *iter, struct bootflow *bflow)
        struct udevice *dev;
        int ret;
 
+       /* handle global bootmeths if needed */
        if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && iter->doing_global) {
                bootflow_iter_set_dev(iter, NULL, 0);
                ret = bootmeth_get_bootflow(iter->method, bflow);
index 188f6ea189545e0a4c93bbd996145d26dc7fc355..bb2dd8447cf492925570c384f292d29da96e3317 100644 (file)
@@ -204,6 +204,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global)
                goto err_order;
        }
 
+       /* start with the global bootmeths */
        if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && include_global &&
            iter->first_glob_method != -1 && iter->first_glob_method != count) {
                iter->cur_method = iter->first_glob_method;
index 3242206772324d866645366fc950996f62f75066..2ef6eb25cf5e4814c673d4b942d8d5530e0083b6 100644 (file)
@@ -250,7 +250,8 @@ enum bootflow_meth_flags_t {
  * @cur_label: Current label being processed
  * @num_methods: Number of bootmeth devices in @method_order
  * @cur_method: Current method number, an index into @method_order
- * @first_glob_method: First global method, if any, else -1
+ * @first_glob_method: Index of first global method within @method_order[], if
+ * any, else -1
  * @cur_prio: Current priority being scanned
  * @method_order: List of bootmeth devices to use, in order. The normal methods
  *     appear first, then the global ones, if any
index 8de5a310add38798f3a52ea6cd796bdffdb16bd6..7cd83dc74433b9f4932a319dc6588a0711945d50 100644 (file)
@@ -401,7 +401,7 @@ static int bootflow_system(struct unit_test_state *uts)
        ut_assertok(device_probe(dev));
        sandbox_set_fake_efi_mgr_dev(dev, true);
 
-       /* We should get a single 'bootmgr' method right at the end */
+       /* We should get a single 'bootmgr' method at the start */
        bootstd_clear_glob();
        ut_assertok(run_command("bootflow scan -lH", 0));
        ut_assert_skip_to_line(