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 83742C433EF for ; Tue, 12 Oct 2021 08:16:16 +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 D20C260F23 for ; Tue, 12 Oct 2021 08:16:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D20C260F23 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 1669482C2B; Tue, 12 Oct 2021 10:16: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=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="fHxup87k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9177082C2B; Tue, 12 Oct 2021 10:16:10 +0200 (CEST) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 6DFFD801B2 for ; Tue, 12 Oct 2021 10:16:07 +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-x52d.google.com with SMTP id w14so26107145edv.11 for ; Tue, 12 Oct 2021 01:16:07 -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=56qeyiy3JrDrEMp0ztXnnZQma6OWtHcc2foxu9NYK+s=; b=fHxup87kFynDLHW7/9ZJn6EXyUrUUhGR75xzAFeH8lCKAMwltVQoMQLOzEA1TdUFAz 7n+je8DTHacL3c3IroD22oi9ay/8wp8SezsipVNIkUa7YzH0UnQ6ky1iktdFXkP3Qd7C svdOC6MuObmdpJUtVaz/fQkCLGY48BJXVSYb3PK3llEbLjKey5f5cWc1ZZ1MjJEQFhq/ y0Sym8TLb6e3lqiOKmj7YZaD6y9ubGLiehcYRuz0O/Yuq9HTZDh3T7FltxxKXaYuWMzz 94ETNQnY+8Lcg1pI80WMqutW2iY62m0+OFHKLzQa7KJE++32FG0PrzDVTxXUqDXM2FEv vaWg== 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=56qeyiy3JrDrEMp0ztXnnZQma6OWtHcc2foxu9NYK+s=; b=mO/LD+4Rvc15HP/vCMR6LhdO2gP/GvL3+rSqy9CN7LodNmoxegfV09vbu6WNd4cfRW 34mn6H5z9oYSeo9y0tv5xNrkzXe7Yu66pPX+FSK8vHwDtkL0A+1BoprlSmmTGaEIY51X nf8CTcZB8vyQ8v7A/m9h9rBxxXCGvn9wkDmbHCmaKX/HtzGju9NUswDCUCUhkSUPP3u/ F7O8cLCKfC+4BaA3dtYi8LqZSzBCvVDEN8EVIRXP579E9R9qRtJvfB5uI8l+u/hF5WnU GKjRDx34Np4fiLqY3uj15lc484KxEwuOq+j9E5YDD1tm+Ke3RcfJg0IoNC3EZLbr66Jy As+g== X-Gm-Message-State: AOAM530K3dxe2nVMy9wWUyZPqoLQmUvT9d66Yywfi8hPLRLyyRMAHbAY BSfL913WWFGvVzycHFpQ+gIkjA== X-Google-Smtp-Source: ABdhPJyZjFDV83820L9yApKEvHbI40zrkQmwcpbTb9TM3mNGOTamesukObxk++Q1HTzNcqHVDbPF5Q== X-Received: by 2002:a17:906:cc9b:: with SMTP id oq27mr30566272ejb.17.1634026566839; Tue, 12 Oct 2021 01:16:06 -0700 (PDT) Received: from Iliass-MacBook-Pro.local ([62.74.11.155]) by smtp.gmail.com with ESMTPSA id dh16sm5317815edb.63.2021.10.12.01.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 01:16:06 -0700 (PDT) Date: Tue, 12 Oct 2021 11:16:03 +0300 From: Ilias Apalodimas To: AKASHI Takahiro Cc: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, u-boot@lists.denx.de Subject: Re: [resent RFC 17/22] efi_loader: add efi_remove_handle() Message-ID: References: <20211004034430.41355-1-takahiro.akashi@linaro.org> <20211004034430.41355-18-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211004034430.41355-18-takahiro.akashi@linaro.org> 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 Mon, Oct 04, 2021 at 12:44:25PM +0900, AKASHI Takahiro wrote: > This function is a counterpart of efi_add_handle() and will be used > in order to remove an efi_disk object in a later patch. > > Signed-off-by: AKASHI Takahiro > --- > include/efi_loader.h | 2 ++ > lib/efi_loader/efi_boottime.c | 8 ++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/efi_loader.h b/include/efi_loader.h > index cfbe1fe659ef..50f4119dcdfb 100644 > --- a/include/efi_loader.h > +++ b/include/efi_loader.h > @@ -579,6 +579,8 @@ void efi_save_gd(void); > void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); > /* Add a new object to the object list. */ > void efi_add_handle(efi_handle_t obj); > +/* Remove a object from the object list. */ > +void efi_remove_handle(efi_handle_t obj); > /* Create handle */ > efi_status_t efi_create_handle(efi_handle_t *handle); > /* Delete handle */ > diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c > index f0283b539e46..b2503b74233b 100644 > --- a/lib/efi_loader/efi_boottime.c > +++ b/lib/efi_loader/efi_boottime.c > @@ -503,6 +503,14 @@ void efi_add_handle(efi_handle_t handle) > list_add_tail(&handle->link, &efi_obj_list); > } > > +void efi_remove_handle(efi_handle_t handle) > +{ > + if (!handle) > + return; > + > + list_del(&handle->link); > +} > + We already have efi_delete_handle(). You can't unconditionally remove a handle unless all protocols are removed. Can't you just use the existing function? Cheers /Ilias > /** > * efi_create_handle() - create handle > * @handle: new handle > -- > 2.33.0 >