summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-10-15 16:44:06 +0100
committerTom Rini <[email protected]>2025-10-22 14:16:56 -0600
commiteca985905d7956ca69e1abfe9ef1d3eb5c64c0a9 (patch)
tree541d96a1a0d7059071667673d5148b068296a201 /boot
parenta2301201e36d665c08b51617e1c66133b32d9808 (diff)
boot: Update first_glob_method when dropping a bootmeth
For now we only support dropping non-global bootmeths from the iteration. Update first_glob_method in that case and add a few checks that things are correct. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootflow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c
index deb5f42ba65..62634a59a94 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -109,11 +109,17 @@ int bootflow_iter_drop_bootmeth(struct bootflow_iter *iter,
iter->method_order[iter->cur_method] != bmeth)
return -EINVAL;
+ log_debug("Dropping bootmeth '%s'\n", bmeth->name);
+
memmove(&iter->method_order[iter->cur_method],
&iter->method_order[iter->cur_method + 1],
(iter->num_methods - iter->cur_method - 1) * sizeof(void *));
iter->num_methods--;
+ if (iter->first_glob_method > 0) {
+ iter->first_glob_method--;
+ log_debug("first_glob_method %d\n", iter->first_glob_method);
+ }
return 0;
}