From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A331C433F5 for ; Fri, 15 Oct 2021 00:36:53 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D328B61056 for ; Fri, 15 Oct 2021 00:36:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D328B61056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3971983676; Fri, 15 Oct 2021 02:36:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="bxo1hLCx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4104C83689; Fri, 15 Oct 2021 02:36:46 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 37FFC83657 for ; Fri, 15 Oct 2021 02:36:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1634258200; bh=UmYJeqAGO4tGtIW2j3uody7acIaAeJXOWliHlrujYdc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=bxo1hLCxoUXvOAJFCxMg07Rxx2HN4UOMJPm5mMyJ1rmCor9sGjTSCH2TR4odFVrwG Q3gX8DvLK2DwjZbhy0HyTigVxeazdiXDcDAYfRsIkyXsj3Kple2Cas5nrMMLb13pjB MLiW4b4RDucExxWhyOHkX6Y3O8HVdH+H8VhgUzEE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([88.152.144.157]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MzQkE-1mwzRw2nbc-00vL7o; Fri, 15 Oct 2021 02:36:40 +0200 From: Heinrich Schuchardt To: u-boot@lists.denx.de Cc: AKASHI Takahiro , Ilias Apalodimas , Alexander Graf , Heinrich Schuchardt Subject: [PATCH 1/1] efi_loader: avoid multiple local copies of lf2_initrd_guid Date: Fri, 15 Oct 2021 02:36:36 +0200 Message-Id: <20211015003637.155195-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:0KtlJex5kV7X3YDwTYKK/wo72/yWU/hXH70xFtgOte+Sqt6xzfw YFmGwEoOow0HI4Zm+DcUhG/+fM29F4ik2DlUrw3thvuDAjoZo0lYecXmOWhgwb0rv3p0Yi1 thFbZivxMUbh26cHucm+CpdCWyqCnqIxo0bweMewoj+hIZE3v0TVlVzoVrASXjqr3v7lzy6 u/EDqhx90DcB3GAvl6HPw== X-UI-Out-Filterresults: notjunk:1;V03:K0:s2IoIPlmcbg=:5MEeiuSVXXiMplEASgra7D tow06tPHs4D45hfR+RJoGM1kiuv0sPscGJcAw8g2XmP9ebk3nbODN+54GEVGDVKXRF4sELeLi gjTLi147ULHyjbdfEaGKdB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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.2 at phobos.denx.de X-Virus-Status: Clean Create the GUID as a global variable. Signed-off-by: Heinrich Schuchardt =2D-- cmd/efidebug.c | 3 +-- include/efi_load_initrd.h | 1 + lib/efi_loader/efi_helper.c | 5 +++++ lib/efi_loader/efi_load_initrd.c | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 33a5135ee1..a977ca9c72 100644 =2D-- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1144,7 +1144,6 @@ static void show_efi_boot_opt_data(u16 *varname16, v= oid *data, size_t *size) struct efi_device_path *initrd_path =3D NULL; struct efi_load_option lo; efi_status_t ret; - const efi_guid_t lf2_initrd_guid =3D EFI_INITRD_MEDIA_GUID; ret =3D efi_deserialize_load_option(&lo, data, size); if (ret !=3D EFI_SUCCESS) { @@ -1165,7 +1164,7 @@ static void show_efi_boot_opt_data(u16 *varname16, v= oid *data, size_t *size) printf(" file_path: %pD\n", lo.file_path); - initrd_path =3D efi_dp_from_lo(&lo, &lf2_initrd_guid); + initrd_path =3D efi_dp_from_lo(&lo, &efi_lf2_initrd_guid); if (initrd_path) { printf(" initrd_path: %pD\n", initrd_path); efi_free_pool(initrd_path); diff --git a/include/efi_load_initrd.h b/include/efi_load_initrd.h index 478ae807c6..be5d5a7acb 100644 =2D-- a/include/efi_load_initrd.h +++ b/include/efi_load_initrd.h @@ -16,6 +16,7 @@ #define EFI_INITRD_MEDIA_GUID \ EFI_GUID(0x5568e427, 0x68fc, 0x4f3d, \ 0xac, 0x74, 0xca, 0x55, 0x52, 0x31, 0xcc, 0x68) +extern const efi_guid_t efi_lf2_initrd_guid; struct efi_initrd_dp { struct efi_device_path_vendor vendor; diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index 89833de222..485384b7ee 100644 =2D-- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -13,6 +13,11 @@ #include #include +#if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI_LOAD_FILE2_INITRD) +/* GUID used by Linux to identify the LoadFile2 protocol with the initrd = */ +const efi_guid_t efi_lf2_initrd_guid =3D EFI_INITRD_MEDIA_GUID; +#endif + /** * efi_create_current_boot_var() - Return Boot#### name were #### is repl= aced by * the value of BootCurrent diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_in= itrd.c index e2a8063023..c5e6652e66 100644 =2D-- a/lib/efi_loader/efi_load_initrd.c +++ b/lib/efi_loader/efi_load_initrd.c @@ -52,7 +52,6 @@ static efi_handle_t efi_initrd_handle; */ static efi_status_t get_initrd_fp(struct efi_device_path **initrd_fp) { - const efi_guid_t lf2_initrd_guid =3D EFI_INITRD_MEDIA_GUID; struct efi_device_path *dp =3D NULL; /* @@ -65,7 +64,7 @@ static efi_status_t get_initrd_fp(struct efi_device_path= **initrd_fp) * We can then use this specific return value and not install the * protocol, while allowing the boot to continue */ - dp =3D efi_get_dp_from_boot(lf2_initrd_guid); + dp =3D efi_get_dp_from_boot(efi_lf2_initrd_guid); if (!dp) return EFI_INVALID_PARAMETER; =2D- 2.30.2