From patchwork Sun Dec 7 20:16:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 824 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138663; bh=/awkBx2OHYB+TyAsBzPAeuSnCr3f94t07hbI3Dck1qU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZSc+i+T0MmUMAhDxNMYf2A9bcYLcU9sFrqxEVkn/6CRMTF8g54h4OKp2Wrzm6nX61 QMfa3yb0RgBocQTBFVHMyGLxO/Q4qbGWvPUnepHXXhdsd02v2Qup+gh5Ve9OBdQjV2 O8WVUOyiTwMIt3KAc4LpDl3TcNZgM4eBnlXM0iYfRMFr+GuKJ1ctsNuYLvvmux1OLN DrmT7YvPTmrR51mTJIAl+drJf8H2il4WVIrcWqrlU8vcuTfnI7xXOrHxNui97yRwJr DDpdsLI4NUt52cBZYeGLRzDr4bG2u4EVDEg38xDt2Qi2juXTRlEzMuuJyvtI4ncSQs y9Xsr4lStla5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 967DB68950 for ; Sun, 7 Dec 2025 13:17:43 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9iQ5d8fr7ZQv for ; Sun, 7 Dec 2025 13:17:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138663; bh=/awkBx2OHYB+TyAsBzPAeuSnCr3f94t07hbI3Dck1qU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZSc+i+T0MmUMAhDxNMYf2A9bcYLcU9sFrqxEVkn/6CRMTF8g54h4OKp2Wrzm6nX61 QMfa3yb0RgBocQTBFVHMyGLxO/Q4qbGWvPUnepHXXhdsd02v2Qup+gh5Ve9OBdQjV2 O8WVUOyiTwMIt3KAc4LpDl3TcNZgM4eBnlXM0iYfRMFr+GuKJ1ctsNuYLvvmux1OLN DrmT7YvPTmrR51mTJIAl+drJf8H2il4WVIrcWqrlU8vcuTfnI7xXOrHxNui97yRwJr DDpdsLI4NUt52cBZYeGLRzDr4bG2u4EVDEg38xDt2Qi2juXTRlEzMuuJyvtI4ncSQs y9Xsr4lStla5A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8312068997 for ; Sun, 7 Dec 2025 13:17:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138661; bh=WUk53fqFf3JCQvruoKayi0DGFFJa/5cwCUVzxgFOdhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h78Ch/maYusJFhBO790tGI9NkQkDcii8cC2ZjxRiGu6icKudKq6Ys0Tv9+gq6OW1a GOJF55BWHblrDkrIOjbhDL3TgGvAi0kYmxNX7KxF5lOozsl2SQOa2VOBI1OyEXAw+d bJHOfn/z9xywHIaLelOrIRfvO1LZqgg+g1EmIrION8rAVXgtmjgnO3XgqeYSryMJTF bGS02lJIFwfRA+KCbWsn0K+esnd/wILT+s8mq+Sl5k1Vd+2ZnFnmPKumvo3A5BKV9u TmIYMdrF2cE2qn0xoYXqE7RHEzFs+0nRBD0Jzr6uWio9erb+gI9yVAt4HSAflT6mef gVthpAex0PiaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3EC8D68997; Sun, 7 Dec 2025 13:17:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id wmU6feztPGjm; Sun, 7 Dec 2025 13:17:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138656; bh=kGBvqGwS9yWqeMgGHMoSntThNkC0nZ+yVXc9CAvhjdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EcWunrLvASyNkr9/PNxdhMpjNd4dgiHfta6LWiYb7aKhFR0LwxygEXawhlqvSLKwU yTqKGxaKBYx+66g8L2ZVYiaB9NubaEDQOQ2YT+pO1ZLsjRVo5TfEfmlWGc/u6gam4a e7d8rzt1Y/sypUS1qKdUCg6LPOWbeguGXi1g9N1dGrj3R7d49ZGV2iA6S8d1j5kANJ YhHzAt/AXfafb+f0cVA8g6k3UU2h5BgmrsieFJN3JqIuit0v7AzPHMXR7dItE7TDe9 y131tdOhmtG7NkZkELA5dHubA5NaIuFS97ua1H/Mwhx9WzEFoEDlzMjrYh6PbCgFdM OlIXRtForpe8w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3239868950; Sun, 7 Dec 2025 13:17:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:09 -0700 Message-ID: <20251207201628.2882382-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DBZTT35BXGRIPVXA4UFEUKLDAW6R5YD4 X-Message-ID-Hash: DBZTT35BXGRIPVXA4UFEUKLDAW6R5YD4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/22] expo: Use better names for objects in bootflow_menu_add() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Use descriptive names like "item0.label", "item0.desc", "item0.pass" instead of generic "label", "desc", "passphrase". This makes debugging easier when multiple bootflow items exist. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 17fab284ef7..84ae0223ba0 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -238,6 +238,7 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, uint preview_id; uint scene_id; bool add_gap; + char name[40]; int ret; ret = expo_first_scene_id(exp); @@ -259,23 +260,30 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, priv->last_bootdev = bflow->dev; ret = expo_str(exp, "prompt", STR_POINTER, ">"); - ret |= scene_txt_str(scn, "label", ITEM_LABEL + seq, + snprintf(name, sizeof(name), "item%d.label", seq); + ret |= scene_txt_str(scn, name, ITEM_LABEL + seq, STR_LABEL + seq, "", NULL); - ret |= scene_txt_str(scn, "desc", ITEM_DESC + seq, STR_DESC + seq, + snprintf(name, sizeof(name), "item%d.desc", seq); + ret |= scene_txt_str(scn, name, ITEM_DESC + seq, STR_DESC + seq, "", NULL); - ret |= scene_txt_str(scn, "key", ITEM_KEY + seq, STR_KEY + seq, key, + snprintf(name, sizeof(name), "item%d.key", seq); + ret |= scene_txt_str(scn, name, ITEM_KEY + seq, STR_KEY + seq, key, NULL); - ret |= scene_box(scn, "item-box", ITEM_BOX + seq, 1, false, NULL); - ret |= scene_txt_str(scn, "version", ITEM_VERSION_NAME + seq, + snprintf(name, sizeof(name), "item%d.box", seq); + ret |= scene_box(scn, name, ITEM_BOX + seq, 1, false, NULL); + snprintf(name, sizeof(name), "item%d.version", seq); + ret |= scene_txt_str(scn, name, ITEM_VERSION_NAME + seq, STR_VERSION_NAME + seq, "", NULL); preview_id = 0; if (bflow->logo) { preview_id = ITEM_PREVIEW + seq; - ret |= scene_img(scn, "preview", preview_id, + snprintf(name, sizeof(name), "item%d.preview", seq); + ret |= scene_img(scn, name, preview_id, bflow->logo, NULL); } - ret |= scene_menuitem(scn, OBJ_MENU, "item", ITEM + seq, + snprintf(name, sizeof(name), "item%d", seq); + ret |= scene_menuitem(scn, OBJ_MENU, name, ITEM + seq, ITEM_KEY + seq, ITEM_LABEL + seq, ITEM_DESC + seq, preview_id, add_gap ? SCENEMIF_GAP_BEFORE : 0, @@ -287,24 +295,27 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, * Create passphrase textline with label and edit field (12 chars). Show * characters as asterisks */ - ret = scene_textline(scn, "passphrase", ITEM_PASS + seq, 12, &tline); + snprintf(name, sizeof(name), "item%d.pass", seq); + ret = scene_textline(scn, name, ITEM_PASS + seq, 12, &tline); if (ret < 0) return log_msg_ret("itp", -EINVAL); - tline->obj.flags |= SCENEOF_PASSWORD; - ret = scene_txt_str(scn, "pass_label", ITEM_PASS_LABEL + seq, 0, + snprintf(name, sizeof(name), "item%d.pass.label", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_LABEL + seq, 0, "Passphrase:", NULL); if (ret < 0) return log_msg_ret("itl", -EINVAL); tline->label_id = ret; - ret = scene_txt_str(scn, "pass_edit", ITEM_PASS_EDIT + seq, 0, + snprintf(name, sizeof(name), "item%d.pass.edit", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_EDIT + seq, 0, "", NULL); if (ret < 0) return log_msg_ret("ite", -EINVAL); tline->edit_id = ret; /* Create message text (hidden by default) for success/error feedback */ - ret = scene_txt_str(scn, "pass_msg", ITEM_PASS_MSG + seq, + snprintf(name, sizeof(name), "item%d.pass_msg", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_MSG + seq, STR_PASS_MSG + seq, "", NULL); if (ret < 0) return log_msg_ret("ipm", -EINVAL);