From patchwork Sat May 13 08:48:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1780912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=EFO/j4c4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QJK6g1p5Hz20KG for ; Sat, 13 May 2023 18:48:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B9DA86207; Sat, 13 May 2023 10:48:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="EFO/j4c4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF631861A5; Sat, 13 May 2023 10:48:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE35984702 for ; Sat, 13 May 2023 10:48:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-088-152-145-137.um26.pools.vodafone-ip.de [88.152.145.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 109D440019; Sat, 13 May 2023 08:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1683967713; bh=9Xw9RsaOJZ5L8umfpniy/tDTtSJfk0MdSxUEm8Cgo6E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=EFO/j4c4PjekTgwN8CQ1+x//MGxOqmnQ9BHceg/bTS3v64p7tUpIRFG/CKfND7ZrJ 1YLEEQoE4y00E51cmXlK3PRXf+VEZoDTkmM6JaXIZBJbAMjwXB35J8tAizqYWTxW1K NaF6l6jtD2mSomxqP+pqy64wFYt7B1tnEjxfS4FyBBrBv+3wJfyeG4CJDnCGdMIkiK ufGDTOvaVSKLL4OGNzhcxwM2jw/h2k+dIAb7damfBGWN5YMg932EMWcJ22CYRyn//x Ec2VhWv4NQxO+7+Ib+rCM+auc/sHAzmcPCmJUr8fL0HGflPKbJfvZpV4+ANbitHtyI smvRSy/4sIFXA== From: Heinrich Schuchardt To: Ilias Apalodimas Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 0/6] efi_loader: fix efi_dp_from_file() Date: Sat, 13 May 2023 10:48:14 +0200 Message-Id: <20230513084820.38625-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean efi_dp_from_file() has multiple issues: * When called from efi_dp_from_name() we miss to append the filename for non-block devices. * When called from efi_dp_from_name we invoke efi_dp_from_part() twice. * expand_media_path() could be simplified by using efi_dp_from_file to prepend the device path of the boot device. This can be avoided by passing a device path to efi_dp_from_file() instead of a block device descriptor and a partition number. efi_dp_from_name() has duplicate code to replace slash by backslash. path_to_uefi() called by efi_dp_from_file() already does this. Heinrich Schuchardt (6): efi_loader: avoid #ifdef in efi_dp_from_name() efi_loader: duplicate code in efi_dp_from_name efi_loader: clean up efi_dp_from_file efi_loader: error code efi_dp_from_name() efi_loader: simplify efi_dp_from_name() efi_loader: fix efi_dp_from_file() cmd/bootefi.c | 2 +- include/efi_loader.h | 2 +- lib/efi_loader/efi_bootmgr.c | 13 ++--- lib/efi_loader/efi_device_path.c | 91 ++++++++++---------------------- 4 files changed, 36 insertions(+), 72 deletions(-)