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 85F64C433F5 for ; Fri, 15 Oct 2021 07:44:21 +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 AAC3061108 for ; Fri, 15 Oct 2021 07:44:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AAC3061108 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 C9FA4831CA; Fri, 15 Oct 2021 09:44:18 +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="nJ2nTXVu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61DD7837D6; Fri, 15 Oct 2021 09:44:16 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 02ED980646 for ; Fri, 15 Oct 2021 09:44:13 +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-x42d.google.com with SMTP id t2so24913916wrb.8 for ; Fri, 15 Oct 2021 00:44:12 -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=bmSko9NArNPH2EodrkZkjPONl21/4j7TnJcJkMj0Y3k=; b=nJ2nTXVuLgL5f9Sjw4Niesucf9lNkogOV9BTAPbkc+ZxJBhfc3ME7FjmklLt46O6kV 8+OZOVg9meIP+lPjT4XcqNL2Tp3c99A8A3WiBlSOLyHPMo80oJbwRhQxdH/sAm+XTXs3 n53Ud2kcSrKCpHiH37VuEMLgNPr6tsnXEISc+xLtTHfXWhdpuVFm9ER7Sglk++0jf8Sh APz+/H7PNSc9tUoqmcUCqbqjpiTRaq0bYAS3MI6ULKHStJqm46Tau1eu3NlJgPZIx/8h yl6u5/cRvPtXag44HL/Z1PXXv/dTKwPfUV+ucFjgWoLxjizNflJzopQuW9rUujo6ooKn 7NNQ== 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=bmSko9NArNPH2EodrkZkjPONl21/4j7TnJcJkMj0Y3k=; b=qZpsVWICljPiP7FEHcDlnwYngeZ+kcSJAtkku//uYyeskHLG1RvpplKe9zvKKlHnaW 25MQ0SZ+48BDerF3Oka7topzdCfe6Ua6XGNrvummFeCgQxj47hnozun+mDYz9GzbNNoQ Wttwsnkl0OqtIBteRGsXBImpV8NFFDNesciFWs4HeWE8bOj+kWjOWfcNhUrkNpyQNoe4 CG74fjd+TQkYLRIP25V991IIqBnNfxqoJddNhLWoCXKB9eUIo0gT25sR+sxAyqmGjZoy HQnaFXeU+PyDCY6V2lMd/T4EnOdVFpJff8ZuVStm75UxD0rE5k/JRBV/IVqkty9zaja8 WDHQ== X-Gm-Message-State: AOAM532ZQAO3BS5M53cbiRjVtEAXtB6GHwvyTA+vbnkGsJRbbB0b7ioG +K24XVuYtT1dwmiOeBZPWZI1gQ== X-Google-Smtp-Source: ABdhPJx+CpoHSjOMqdASZK8NO2Rw/WIKYcQBhZc1vu237tKcdtj+EemDPYMWcLAs1gbQbcmuhw1bIQ== X-Received: by 2002:adf:dc43:: with SMTP id m3mr12413154wrj.66.1634283852541; Fri, 15 Oct 2021 00:44:12 -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 f127sm9407883wmf.16.2021.10.15.00.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 00:44:12 -0700 (PDT) Date: Fri, 15 Oct 2021 10:44:09 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, AKASHI Takahiro , Alexander Graf Subject: Re: [PATCH 1/1] efi_loader: efi_dp_from_lo() should skip VenMedia node Message-ID: References: <20211015013815.195615-1-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211015013815.195615-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 03:38:15AM +0200, Heinrich Schuchardt wrote: > The 'efidebug boot dump' command should not display the VenMedia() device > path node preceding the device path of the initial ram disk. > > By letting efi_dp_from_lo() skip the VenMedia() device path node we can > simplify the coding. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_device_path.c | 2 +- > lib/efi_loader/efi_helper.c | 19 +++++-------------- > 2 files changed, 6 insertions(+), 15 deletions(-) > > diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c > index aaf1999d46..7f2aa239de 100644 > --- a/lib/efi_loader/efi_device_path.c > +++ b/lib/efi_loader/efi_device_path.c > @@ -1287,7 +1287,7 @@ efi_device_path *efi_dp_from_lo(struct efi_load_option *lo, > > vendor = (struct efi_device_path_vendor *)fp; > if (!guidcmp(&vendor->guid, guid)) > - return efi_dp_dup(fp); > + return efi_dp_dup(efi_dp_next(fp)); > } > log_debug("VenMedia(%pUl) not found in %ls\n", &guid, lo->label); > > diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c > index 485384b7ee..b80a6e07df 100644 > --- a/lib/efi_loader/efi_helper.c > +++ b/lib/efi_loader/efi_helper.c > @@ -68,10 +68,8 @@ out: > */ > struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid) > { > - struct efi_device_path *file_path = NULL; > - struct efi_device_path *tmp = NULL; > struct efi_load_option lo; > - void *var_value = NULL; > + void *var_value; > efi_uintn_t size; > efi_status_t ret; > u16 var_name[16]; > @@ -86,18 +84,11 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid) > > ret = efi_deserialize_load_option(&lo, var_value, &size); > if (ret != EFI_SUCCESS) > - goto out; > - > - tmp = efi_dp_from_lo(&lo, &guid); > - if (!tmp) > - goto out; > + goto err; > > - /* efi_dp_dup will just return NULL if efi_dp_next is NULL */ > - file_path = efi_dp_dup(efi_dp_next(tmp)); > + return efi_dp_from_lo(&lo, &guid); > > -out: > - efi_free_pool(tmp); > +err: > free(var_value); > - > - return file_path; > + return NULL; > } > -- > 2.30.2 > Reviewed-by: Ilias Apalodimas