[PATCH 18/19] expo: Honour the textline edit_id when building

Simon Glass sjg at chromium.org
Mon May 5 17:42:56 CEST 2025


There is no need to create a new ID and it makes it harder for tests to
locate objects. Use the ID provided in the file, if any.

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

 boot/expo_build.c | 6 ++----
 test/boot/expo.c  | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/boot/expo_build.c b/boot/expo_build.c
index d97347e1725..9a99a21e5e0 100644
--- a/boot/expo_build.c
+++ b/boot/expo_build.c
@@ -286,7 +286,7 @@ static int textline_build(struct build_info *info, ofnode node,
 			  struct scene *scn, uint id, struct scene_obj **objp)
 {
 	struct scene_obj_textline *ted;
-	uint ted_id, edit_id;
+	uint edit_id;
 	const char *name;
 	u32 max_chars;
 	int ret;
@@ -301,7 +301,6 @@ static int textline_build(struct build_info *info, ofnode node,
 	ret = scene_textline(scn, name, id, max_chars, &ted);
 	if (ret < 0)
 		return log_msg_ret("ted", ret);
-	ted_id = ret;
 
 	/* Set the title */
 	ret = add_txt_str(info, node, scn, "title", 0);
@@ -311,10 +310,9 @@ static int textline_build(struct build_info *info, ofnode node,
 
 	/* Setup the editor */
 	info->err_prop = "edit-id";
-	ret = ofnode_read_u32(node, "edit-id", &id);
+	ret = ofnode_read_u32(node, "edit-id", &edit_id);
 	if (ret)
 		return log_msg_ret("id", -ENOENT);
-	edit_id = ret;
 
 	ret = scene_txt_str(scn, "edit", edit_id, 0, abuf_data(&ted->buf),
 			    NULL);
diff --git a/test/boot/expo.c b/test/boot/expo.c
index b97a04e1102..b025e48469f 100644
--- a/test/boot/expo.c
+++ b/test/boot/expo.c
@@ -819,7 +819,7 @@ static int expo_test_build(struct unit_test_state *uts)
 
 	ut_asserteq_str("name", exp->name);
 	ut_asserteq(0, exp->scene_id);
-	ut_asserteq(ID_DYNAMIC_START + 24, exp->next_id);
+	ut_asserteq(ID_DYNAMIC_START + 23, exp->next_id);
 	ut_asserteq(false, exp->popup);
 
 	/* check the scene */
-- 
2.43.0



More information about the U-Boot mailing list