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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DF616C433F5 for ; Mon, 10 Oct 2022 08:01:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BA8CA84E23; Mon, 10 Oct 2022 10:01:34 +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="wsf2+v0g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92F8C84E2D; Mon, 10 Oct 2022 10:01:33 +0200 (CEST) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 8F14F84E1D for ; Mon, 10 Oct 2022 10:01:30 +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-ed1-x52c.google.com with SMTP id z3so13800588edc.10 for ; Mon, 10 Oct 2022 01:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=N4oq6h0ssMlToAT8aouz9b132EIbZUjvZLDPeHPVkhk=; b=wsf2+v0gxCMwTIdTIeAazEkXGvQo/Zt14kIRvZM36whjhnOWUfI+61Fg552qwcxa63 4Us+gweV+myLMsap74Kn3rmhZJdBIbm7VI51n2frikAMhDa4SScrl5zUsQFolplmhT2W WDLX2YYzPXRWKWFnPE0rsk15GS2nRpHYBKEXkPQFVy2yaV+38hRmbL93V/87FFEwV8Z9 pQaDfjH5F74jS8uvhkRY4hVf3Fq6I3biJUqPkMaaYanQMWKsLXPmWZkiSOrC9jyOMP/W Oiae4MxeDYz1KvB0uAZDMzBRLDvaHhVRSRQtuObngvqaGH/T81nkPPK9r8M1SM/zv0y3 f/Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=N4oq6h0ssMlToAT8aouz9b132EIbZUjvZLDPeHPVkhk=; b=X/RZYLpg2DHB193Fc7CrVj4hIteC/HI+B+pl5Q/2UgfVr3ODZ+aAqErSFc0776e16S EAJlA8CXze+W+8/WxIWXZJcYnULCpbVkj8WrrWH04s6/6ufVp1xtIOEfjO2e+H1U1scO agdXAZP/jc/km7SkVOex6MVeJ2kWCpUS5xFO3eZeclsiwPbfCtUsOqfc1DNDNQ2s5TWf pekc0GWu1mTqqH45WKDAjnEythbDQYe14SYNyY6MReXvw72x4DDuHXLKkcIt963Gg6Th I87slcBcF9odTAXVuEEiOPeCEKojijeTAOMIKlw0vn2R1dSKw/8CkDv4fa6Xpnbv5Xwm 72nw== X-Gm-Message-State: ACrzQf3Kg91kItQbonLnf6QTO/840KBqEVWx58FavxTQMYmSD7HA16zq 7itK3Zr0fcai2ZdUlHMPvKeRFw== X-Google-Smtp-Source: AMsMyM4d+w/LfvWtskkOL1nr3VMNRD5hL6l7/yTaht51RrMb5Bi3Hhp9F2+ylJXyGLTSdSH6eAgiXg== X-Received: by 2002:a05:6402:1cc1:b0:453:1517:94e4 with SMTP id ds1-20020a0564021cc100b00453151794e4mr16669055edb.399.1665388890183; Mon, 10 Oct 2022 01:01:30 -0700 (PDT) Received: from hades (ppp046103015185.access.hol.gr. [46.103.15.185]) by smtp.gmail.com with ESMTPSA id p2-20020a056402044200b00458c07702c1sm6583189edw.23.2022.10.10.01.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 01:01:29 -0700 (PDT) Date: Mon, 10 Oct 2022 11:01:27 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: Re: [PATCH 1/1] efi_loader: simplify efi_set_load_options() Message-ID: References: <20221008071300.5902-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221008071300.5902-1-heinrich.schuchardt@canonical.com> 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.6 at phobos.denx.de X-Virus-Status: Clean On Sat, Oct 08, 2022 at 09:13:00AM +0200, Heinrich Schuchardt wrote: > * Replace the OpenProtocol() call by efi_search_protocol(). > * Remove the CloseProtocol() call. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_load_options.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c > index 71454f0fc6..3cfddee014 100644 > --- a/lib/efi_loader/efi_load_options.c > +++ b/lib/efi_loader/efi_load_options.c > @@ -27,23 +27,18 @@ efi_status_t efi_set_load_options(efi_handle_t handle, > void *load_options) > { > struct efi_loaded_image *loaded_image_info; > + struct efi_handler *handler; > efi_status_t ret; > > - ret = EFI_CALL(systab.boottime->open_protocol( > - handle, > - &efi_guid_loaded_image, > - (void **)&loaded_image_info, > - efi_root, NULL, > - EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL)); > + ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler); > + loaded_image_info = handler->protocol_interface; > if (ret != EFI_SUCCESS) > return EFI_INVALID_PARAMETER; > > loaded_image_info->load_options = load_options; > loaded_image_info->load_options_size = load_options_size; > > - return EFI_CALL(systab.boottime->close_protocol(handle, > - &efi_guid_loaded_image, > - efi_root, NULL)); > + return EFI_SUCCESS; > } > > /** > -- > 2.37.2 > Reviewed-by: Ilias Apalodimas