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 80D96C433EF for ; Fri, 15 Oct 2021 07:33:50 +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 BAA1660F23 for ; Fri, 15 Oct 2021 07:33:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BAA1660F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 8CB9E80EFB; Fri, 15 Oct 2021 09:33:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="eX3JzgNP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81D2080646; Fri, 15 Oct 2021 09:33:45 +0200 (CEST) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F096480646 for ; Fri, 15 Oct 2021 09:33:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wr1-x429.google.com with SMTP id g25so24737984wrb.2 for ; Fri, 15 Oct 2021 00:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NEy0bQwbwQgy+xasjl+tZVzjkcvnmRxwwt8l94IM19M=; b=eX3JzgNPpuGiGojhX9IIbeOwDnbCigmRNXL84UcfKKm1lhtLoBdsCFuiM1pLAgIKUA ha8wiWvoVH+GdKJlUxpHSFS2xFNaIvDQPbhQYP/EQhplNNcp1ARrB+a2TE6oDOW/aJBg r2M3p54HRqIROI0IWKDtR7751Rte9QQFTBCGsuWJ1t0kbhf4ueQBVx+J+Dmlu2A42xmF aKgEhB1tQe69WzlZWxopout5vBNK/IYZDeCHQfZvNASf/+UQtnwdWi+i1Uhi+2KNSvRg lekmpnzc6hjTJRHnn85Zf2bPgFaPAJtDgdusunUq/+QD48V+UdkC6BBJ7TWtRfg8XOdN EL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NEy0bQwbwQgy+xasjl+tZVzjkcvnmRxwwt8l94IM19M=; b=p0WNA9S6ecj2Vt+eLkIHBfW3s1V6L7hl2t/Mt0aZBe4QKPOMXTArsxhNDqj6wc5pjr UF2RJnpby5/R0EuhsUpiz9I7fFIy+vu8IUQVtBaFk1GO9a8GfuDi+lfY2ET80uRWJ0AF zX/RAo5BS/5stIxbRnxk+j13+tLTAuEqEfyKpliRL00MpLft9np3/s8fh5wFYTpB/znv zOp3kJwPuy9ygpSTVuaNIDpJnFxHz9csckKsaxrdOT8eeo77T0nKQaV8aXb3YAhCzGOZ LFnjYrfhC12i2eazbD88p+oDd8ap/FqjOHkKb3lZw3fzNxPrReSjt44d78ATd77y5dSX W1Bw== X-Gm-Message-State: AOAM5309ULVX6fcCCt7mghXqzS6EiBW0WfFBM8S0JBTw2q/6ZUL/cJ7k J4ATP8Y9ymAWRzIeGwUbLYdLeQ== X-Google-Smtp-Source: ABdhPJy71Ys/rbVXpYwQ+sjUBguTJVWl6Pzv+Zbq4e0xEVo4WjaBjCFhDUsyFWA1RWnvdRCXhsh9Rw== X-Received: by 2002:a5d:4344:: with SMTP id u4mr12703003wrr.106.1634283221497; Fri, 15 Oct 2021 00:33:41 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-13.home.otenet.gr. [94.66.220.13]) by smtp.gmail.com with ESMTPSA id k10sm9679978wmr.32.2021.10.15.00.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 00:33:41 -0700 (PDT) Date: Fri, 15 Oct 2021 10:33:38 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, AKASHI Takahiro , Alexander Graf Subject: Re: [PATCH 1/1] efi_loader: avoid multiple local copies of lf2_initrd_guid Message-ID: References: <20211015003637.155195-1-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211015003637.155195-1-xypron.glpk@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Fri, Oct 15, 2021 at 02:36:36AM +0200, Heinrich Schuchardt wrote: > Create the GUID as a global variable. > > Signed-off-by: Heinrich Schuchardt > --- > 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 > --- a/cmd/efidebug.c > +++ b/cmd/efidebug.c > @@ -1144,7 +1144,6 @@ static void show_efi_boot_opt_data(u16 *varname16, void *data, size_t *size) > struct efi_device_path *initrd_path = NULL; > struct efi_load_option lo; > efi_status_t ret; > - const efi_guid_t lf2_initrd_guid = EFI_INITRD_MEDIA_GUID; > > ret = efi_deserialize_load_option(&lo, data, size); > if (ret != EFI_SUCCESS) { > @@ -1165,7 +1164,7 @@ static void show_efi_boot_opt_data(u16 *varname16, void *data, size_t *size) > > printf(" file_path: %pD\n", lo.file_path); > > - initrd_path = efi_dp_from_lo(&lo, &lf2_initrd_guid); > + initrd_path = 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 > --- 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 > --- 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 = EFI_INITRD_MEDIA_GUID; > +#endif > + > /** > * efi_create_current_boot_var() - Return Boot#### name were #### is replaced by > * the value of BootCurrent > diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c > index e2a8063023..c5e6652e66 100644 > --- 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 = EFI_INITRD_MEDIA_GUID; > struct efi_device_path *dp = 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 = efi_get_dp_from_boot(lf2_initrd_guid); > + dp = efi_get_dp_from_boot(efi_lf2_initrd_guid); > if (!dp) > return EFI_INVALID_PARAMETER; > > -- > 2.30.2 > Reviewed-by: Ilias Apalodimas