From patchwork Thu Sep 25 17:47:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 421 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=1758822522; bh=zLmjftVwgn7ljtFxWMeUNiGB5VR0nBajVMXdtqOjkLE=; 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=fZvecN9XgxoslORukxEVMRBtdT0HKmABZ2Ts+OI3xSCsRvd0MRF7YN+sEufQ6SQLI clPQIALLWVGFLgW2eiN1BvoTnBbJjpBnzyU+fjUJAVCR4nC5WOhI3w/kHAUs4lZlpH zX1yXyIyv6Rq0oRfvzLmwG2wLfybcKye4Qh4UziTdH6UNxTEBheFeGqjmu5kclYL1N Q1cWGdAw4dFkqv3jqeMdG2gG0F/ItirtRb38BY/peRIH8/7cI781/7meMMhsYe3KAl x+mydZ0LdI4r0weeAU14ImtcAxn3yMRdbLLoHp84s7zfAuHLOMUVRHxqWkWwFnsbTZ UqJ0q/GjI3UxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 404A367D8F for ; Thu, 25 Sep 2025 11:48:42 -0600 (MDT) 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 VdQER-ieXb6h for ; Thu, 25 Sep 2025 11:48:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758822520; bh=zLmjftVwgn7ljtFxWMeUNiGB5VR0nBajVMXdtqOjkLE=; 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=JitzFeza9b3i+hy9RNXaw+JKPZvtqY7ECfOZRYc+GC7eV0ogRSA4i4lD6URbvN/pX ls6ez4t+EovvE0vL79iEqEOxxtIrpLij49gp4DdjFCK5/pw+06ieh9CXm6bcIbfbE8 Gbpiyd3YXQ23pK8t7uQLn5Ga4azCZ7rhR81PCmfAav0Odg/XCEKy0fduLWNxFCk5Sh fEn0ra/JvIFuARod+UApN61bVtzaDxY1sT+30KJHSpmiJD7w1ZW5WE/P57wKtryd+t kZLjYI0tuYPDyVHT7ljExqgjaDVgYYeboB6c7Iina1Dfw/lvYcOnXu/AL0nZuMXCI6 lh/fC7RtYHx1A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3A98967D29 for ; Thu, 25 Sep 2025 11:48:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758822519; bh=wOHMmJ+PzDi2FeTBJk54Jb0n4HrABlFji9L0R2zGCJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aIJOo36BPbwvjr7uOM65ktudI29D0JQbRhYecmxNxJnmOwOVf9SxE5Wca2v7Q3VVR jsBksuUI36bN6ODPJXnOlzVqOsjTzIVMPXryj3SdzKDIm1Cy8rseFjwVjjGgMCyVpO u2lTBSHhpTiCG/yJCk/pV6rsjKi2dpFmEC82CObixp2zU8ah+pIiTnAPbxPrtJMvO9 IjAp2o7mbDB1vd6itTEqdWP1N1NAm6yfrDM9MW8tVgF1J2jR7HyAQN0H00vjyal/PR VS5GlKKEhdApRMTW37+Jnmifr+DVv0H8ak2Xh1VLRBb8Ukj8RwW1+YM3CFp9KZStSy aJ54EChwOKhKw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5788067CAC; Thu, 25 Sep 2025 11:48:39 -0600 (MDT) 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 8-6b8IWFvSMl; Thu, 25 Sep 2025 11:48:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758822518; bh=MsxQElVO4+gP2XJbErtLabS/Y9ek0gMEg5SYPxyNttc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RxbFvi3D/TOD0q4GB4r/0OYelnrdHDzIzdYkfQAuRqen+740x2xmPfnHS4i0e7ODT rbOHnovMHp3wqSUOVd5YrzMFyJ3gobelQFCqsuAYDXojtoFBfbyvro9qc50hiODYyE BI++vABo0lpgU5HXMn+vkyQFIHsn+QspWwJzH+c7k5gimh7WAklKNrWXiiMfzYTOQ8 qnMX3r2fcPrIkoPlbm/M9ecUMn+DaiMvRu5ZOx82U1+S6wTqL96cvP0AqY568fnQss YPZucg7xIOwBs6qIQrKWNNMSm1O89e2UdUkcQ7GXNk7UoScHR14X9yuMYo92SYO8WH FAwCy+S6Z47Jg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1C5E767CEF; Thu, 25 Sep 2025 11:48:38 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 25 Sep 2025 11:47:33 -0600 Message-ID: <20250925174753.3429102-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250925174753.3429102-1-sjg@u-boot.org> References: <20250925174753.3429102-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QUKZ6XD5W3VK6B337ZOGK5D7DB6QGLLK X-Message-ID-Hash: QUKZ6XD5W3VK6B337ZOGK5D7DB6QGLLK 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/22] cmd: part_find: Correct radix and calls 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 Recent work removed the if_type member. Update the code to use the new method for obtaining the interface type. Use hex so that large partition numbers (>=10) work correctly. Signed-off-by: Simon Glass --- cmd/part_find.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/part_find.c b/cmd/part_find.c index c39fce21e40..68b66569204 100644 --- a/cmd/part_find.c +++ b/cmd/part_find.c @@ -107,7 +107,7 @@ static int part_find(int argc, char *const argv[]) &loader_part_no)) { char env[256]; - ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no); + ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no); if (ret < 0 || ret == sizeof(env)) return CMD_RET_FAILURE; if (env_set("target_part", env)) @@ -123,7 +123,7 @@ static int part_find(int argc, char *const argv[]) break; if (strcasecmp(argv[1], info.type_guid) == 0) { char env[256]; - ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, i); + ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_uclass_name(desc->uclass_id), desc->devnum, i); if (ret < 0 || ret == sizeof(env)) return CMD_RET_FAILURE; env_set("target_part", env);