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 3D097C433EF for ; Wed, 13 Oct 2021 00:55:27 +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 94CDD60EDF for ; Wed, 13 Oct 2021 00:55:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 94CDD60EDF 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 5861A8332C; Wed, 13 Oct 2021 02:55:23 +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="La94kH0s"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A5B528187B; Wed, 13 Oct 2021 02:55:20 +0200 (CEST) Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0: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 64B2183124 for ; Wed, 13 Oct 2021 02:55:16 +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=takahiro.akashi@linaro.org Received: by mail-pg1-x52d.google.com with SMTP id s75so684975pgs.5 for ; Tue, 12 Oct 2021 17:55:16 -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:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=BIjl/10mGIj8LoLOtM4o+xHkBGWDQgOsGcy5j2pTXYg=; b=La94kH0sEi2bJuwKWQjdx4z1i+0GwZEI1uhivoMdv0Ugy4Fmsb71SECGQgPno6H/PF Eyj0SjuGkck6RlD5RiLt0ch3UZV9LU4JLgrUlUVPfweKxtyNPQnuSsKQJG6Ocr8HGCn0 7qNXTyPYI7bUi90m3rODs2syWifgNyu3wRueoJ8imsq59eRgTcCEZKL6dQ6XTFtaLeHE 0jiEjSydgGbIzaT9uW6HYQ9JmcEmIxZKxdUxNV1EFaZWkSdzxY5tfnxmt7lV2n+YrqJI XGqyv3mztL40HVT8hA9IxZf4/rrGl5AoVIp/BfPOCzi97ZnrvDo3qrnRpsWAo5bKPHJG 0vDw== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=BIjl/10mGIj8LoLOtM4o+xHkBGWDQgOsGcy5j2pTXYg=; b=c9rwheUHpuXhGd6Lq+Rvqf+nHjavy+OzqW2kzUhxgeHBdqvrnj46A+jO6UM01X3hUs cTGhlVTt0UbiUStRYZgHEuT05Df3zhTV63LGG/tfBznaO3U6u7EG6z/Fvdt39MsvDncs NNPsQ3Qf3tdXgw0a1heh7ulrO5TQ/Lz3RA7w3Q7aGJosHWQFc0cRkH5JmZdqlVlBTeUE 4V7MBKJYa/fxLAwqRn8w85Xic6wL5ZF0iHjL+xLStyYULJL8mRuzufTgiEyjEdecAQN4 yX7/nT041wa0aZD2eAPi1uSmfBsAIAc6EwmWgWG1cmEIdBgDNCEcedJUxthhefdHkXYf pkMg== X-Gm-Message-State: AOAM533tmVNlIs5bWGjRWYy+rBlemBvkk39b2srUjKNVmvP2HWLMzoqv 4MrgDzXD8Yuje46LrzKUxl687g== X-Google-Smtp-Source: ABdhPJzaOI17gTaW5YpUk1FRd5TGDDIrhUJZ0ID5jN4uDWCz0YB9sKfiSv/ZtvwL3Wy+yjTdTF2L/Q== X-Received: by 2002:aa7:868f:0:b0:44c:fa0a:2c3c with SMTP id d15-20020aa7868f000000b0044cfa0a2c3cmr21083251pfo.49.1634086514634; Tue, 12 Oct 2021 17:55:14 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:1d60:171b:3906:2add]) by smtp.gmail.com with ESMTPSA id 188sm4158881pff.196.2021.10.12.17.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 17:55:14 -0700 (PDT) Date: Wed, 13 Oct 2021 09:55:10 +0900 From: AKASHI Takahiro To: Ilias Apalodimas 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: <20211013005510.GB43695@laputa> Mail-Followup-To: AKASHI Takahiro , Ilias Apalodimas , xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, u-boot@lists.denx.de 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: 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 Tue, Oct 12, 2021 at 11:16:03AM +0300, Ilias Apalodimas wrote: > 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? My intent was to add this function as a counterpart of efi_add_handle() since not all the handles are dynamically allocated on its own. As far as my usage in this patch series is concerned, however, it is always used accompanying efi_remove_all_protocols() and free(). (See efi_disk_delete_xxx() in efi_disk.c) So, yes we can use efi_delete_handle() instead. (assuming 'header' is the first member in struct efi_disk_obj.) -Takahiro Akashi > Cheers > /Ilias > > /** > > * efi_create_handle() - create handle > > * @handle: new handle > > -- > > 2.33.0 > >