From patchwork Wed Aug 20 14:46:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 84 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=1755701219; bh=AGAWeMnmwEE9V/d5POC9ZK19MmwQUdO5AsEdijcszM4=; 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=w94rm1DoaIu7upAyYbF2e7oQS3554hoVO6C+zVuVZ2aU4KUPW0tXZoTCRcXy83zK7 qXotXYMBJsAjoZZvv/5yUqfsyzCFD9VPcLdj+eaE+bqHe9Pr6E0kE2K9/7pNqFDsQq bXfrn0rS5NxOJNvuG7LZDuzUYNhOGR/IFVrkLnQYzYmxYF58XlitMFV9DsrVRRIHQJ vC11mKDXeHfZ2XaQ3xj2dkCAzIvGdG1MJe5YeVV8o3tW0m4ROVIwHikifco8BSn8mU C3U1ce5AOGw/fscOwPcRO07EeNZoYrr4VBCU7xQTROfoskD9uYq7MMrRG0NNTBkAxE Wp2g8EBcI+eYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D97A674FA for ; Wed, 20 Aug 2025 08:46:59 -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 fqPcILIV1_D4 for ; Wed, 20 Aug 2025 08:46:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=AGAWeMnmwEE9V/d5POC9ZK19MmwQUdO5AsEdijcszM4=; 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=TuniXniRxah5AIayu5UecAobRy2BUIuCyahBXArGLZ2ydZML0UENQB0HQUl6zz6L8 XJ+0QfrHQG7XD6Bkl5LD1nlnDycVJgtA70snndMdXQOmHZdLDFfTcdgXhaAhdYyHEV ytApuNZB+Wb6Jo5XjodSc07sxJCefdKEMqmzDvnMzylcB1mEzLk/RPWaasQRq9S/KG mUU+fVPZr7XiV4SMMQlBA4WoTNZXG7qcv/1mkC25JnmjNIHh56xLSJPQER4INIWP7z SGZiBtsryTArm3WJ09rQKPxWSV/D/BceZMIqXaVKaxFq29R3QKGVszUGM/ReuJIoEM 5VVPV4vM/NILg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFF6F6769C for ; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701216; bh=Z7KPzbKB6H/lIdj+NIapULdeIpoZAu2sTxnTc/V7nwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEz0aOexHn6PlRq/RIzdwE1Mh8p4gQVyTpEHuMRjycZ2Prz0wVrrU8ADvAt9TLgz1 wynFckSBiWLS2Ojl7gIazaGmk3kLougGHfBtl9dy629ryRZy5RsfyP3mGJ5xXRKQhe g0ofZWAWTPIffVdr3wJ9l4UzE3VOgUE63zxdqR11OO1/ZDTWrIcMBlTzOW4mPy5SSS QL/sjGZbEqzJo52X5E1H818mHePpcQaZ++nLqZanfgN1UExSLCcaeAygh3Ytpz9sKJ 5xT1s9D9JA+PseAdijqxUIQo3NrsEWoAL84DzY/uTIfhsSYkqoeWArlcYU5i2YtQOL H4jYAxAfSlm6g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E574676B0; Wed, 20 Aug 2025 08:46:56 -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 Q_TIjbrfkoRB; Wed, 20 Aug 2025 08:46:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701207; bh=7xYvvLiMl3aBestEOLRYt6p0RyOmckfvEQg8fFx3MEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRErRIvqYQzqdu8H+/G/gWDZZvTJ4IexJmQYNGthLl2KEcWXFXD8enChAysvqTZ6k ICaWJS0zxyJsOwtzhTKtP2vyhN3dYE/RhAAf4HoP10UkHJlt+ezpwo1qh8l1WtpvqC 8YI+YgDbnpL/Y6w7hZPfNO4YxcNFplttDPCyv8LdC3Brx8mYyTEOg139Ma23NCJ4bN WI2IMWHm4VrMWKSg+Pki1kmzjisKmwasAjGIuH0euRJ3/EPILQApOmkFVTJFJyGCvB cXc/hoBY8wY4Pg5HofiKYlOK6dpq25NMqYq2I/zjs1R9FeASYDkvyuNTxDeyuM9uK+ Nzohpa6CclGqA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 987C9676A0; Wed, 20 Aug 2025 08:46:47 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:08 -0600 Message-ID: <20250820144621.1073679-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KA5MTEC35SFTJ5PXZYR2ROWVA5IC5UV3 X-Message-ID-Hash: KA5MTEC35SFTJ5PXZYR2ROWVA5IC5UV3 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 06/14] efi: Use a local var for a handle with efidebug dh 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 Rather than repeating handles[i], put it in a variable. Signed-off-by: Simon Glass --- cmd/efidebug.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index d7f88692d8c..a6a0e877798 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -480,18 +480,24 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, return CMD_RET_SUCCESS; for (i = 0; i < num; i++) { + /* + * this cannot be dereferenced in the APP since the format is + * defined by the underlying EFI implementation, which is likely + * not U-Boot + */ + efi_handle_t handle = handles[i]; struct efi_handler *handler; - printf("\n%p", handles[i]); - if (handles[i]->dev) - printf(" (%s)", handles[i]->dev->name); + printf("\n%p", handle); + if (handle->dev) + printf(" (%s)", handle->dev->name); printf("\n"); /* Print device path */ - ret = efi_search_protocol(handles[i], &efi_guid_device_path, + ret = efi_search_protocol(handle, &efi_guid_device_path, &handler); if (ret == EFI_SUCCESS) printf(" %pD\n", handler->protocol_interface); - ret = efi_get_boot()->protocols_per_handle(handles[i], &guid, + ret = efi_get_boot()->protocols_per_handle(handle, &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) {