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 BC537C433EF for ; Wed, 23 Mar 2022 06:55:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 23F6B83BDB; Wed, 23 Mar 2022 07:55:42 +0100 (CET) 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="zDNmgLFy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25AB983BCF; Wed, 23 Mar 2022 07:55:41 +0100 (CET) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 CE19183B2C for ; Wed, 23 Mar 2022 07:55:37 +0100 (CET) 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-x531.google.com with SMTP id z128so416948pgz.2 for ; Tue, 22 Mar 2022 23:55:37 -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=A45K0Xk8+L9nPWfx+Y1JB11cVcmxMgXCFDM8DiDGvBQ=; b=zDNmgLFyan86AWT7xRhw6VdBURZhRS9F6J+alqw0vltLHrj5B5930bXj3BFhi8AR/v yEHk2zuGDKh5xhGpc40ou4vJK0ErOUIJJSakWh3gkJyNcDrNJoMVsJU33L96MWeGHLpn aUhQuGr/9nW0iGuSpFsGGNdm9YWquxKTKVV8rCbkj020jQ0SXhukjlSLIENbE8AmZ3Fx PqtUvX7lnE0DvGDzJqsYt8xN9AjjSZFtmwFgwOZDwHRuo+Q26BVf50wx8kl+DGgs5hB/ W4SvTi6tVVIu8TQk6vxSYpwYXAXe6gBdF/IIV9DpOKjXspbRcG5v9RToNvtd6goi9laN PWOg== 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=A45K0Xk8+L9nPWfx+Y1JB11cVcmxMgXCFDM8DiDGvBQ=; b=yqVWnj1KP1Ze0sH0nR8tjKXEssn7+CFyqk37sujjgzIqchqZcFAV4EZ3xaBkwEoAzt NE7QC7UxQToPPAj0KyE6y83NTZoPqDrrnvVhtLODTJLNBcN5ryz5mXkzdfjSQga/T4ty 8s214reoOmHVPC9JdQcTq+Alz9jOq2PW1yF+VmfLD+flcci0XbOEXg3tukDtlePanlbn RJuVKTbZ71qshF18sXVirc4F5SVfpQGolqTfiA4RsLitaVUNm0bpDGXE6toY9rSGMe1d R3Y8uuTBW9X0BUavPgQCaiv7RuoA0FqAoLcLCIHnmIU4FANmoE3PXLOz7DQwpdI7fqww DL4Q== X-Gm-Message-State: AOAM531EBcydajRa3Gskmwwrv2HZskEPaGWdK8FfzdO5tnmapp0eu6vE 5e6m0P4GSiwnEqJiGHfW1Z/FyA== X-Google-Smtp-Source: ABdhPJyE6LTFJXGaPocTZWg2h3Gfy9+aduq7pyTWLrlv7ipTAWqI0YuCvkasQe6OdSpvsKOanr3uLA== X-Received: by 2002:a05:6a00:18a2:b0:4fa:8b24:fb85 with SMTP id x34-20020a056a0018a200b004fa8b24fb85mr18464553pfh.28.1648018536247; Tue, 22 Mar 2022 23:55:36 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:2199:5d47:ea3f:788f]) by smtp.gmail.com with ESMTPSA id 5-20020a17090a1a4500b001c54dc9061esm4616550pjl.51.2022.03.22.23.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Mar 2022 23:55:35 -0700 (PDT) Date: Wed, 23 Mar 2022 15:55:32 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Ilias Apalodimas , Heinrich Schuchardt Subject: Re: [PATCH v2 1/9] efi_loader: export efi_dp_shorten() Message-ID: <20220323065532.GB49108@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, Ilias Apalodimas , Heinrich Schuchardt References: <20220319091148.142036-1-heinrich.schuchardt@canonical.com> <20220319091148.142036-2-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220319091148.142036-2-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.5 at phobos.denx.de X-Virus-Status: Clean On Sat, Mar 19, 2022 at 10:11:40AM +0100, Heinrich Schuchardt wrote: > From: Heinrich Schuchardt > > Rename function shorten_path() to efi_dp_shorten() and export it. If you really want to rename the function for export, please give it a more proper name as "shorten" is quite vague. Say, clip_short_form_path() or drop_media_device_path(). -Takahiro Akashi > Signed-off-by: Heinrich Schuchardt > --- > v2: > new patch split off > --- > include/efi_loader.h | 3 ++- > lib/efi_loader/efi_device_path.c | 21 +++++++++++++-------- > 2 files changed, 15 insertions(+), 9 deletions(-) > > diff --git a/include/efi_loader.h b/include/efi_loader.h > index 110d8ae79c..1ffcdfc485 100644 > --- a/include/efi_loader.h > +++ b/include/efi_loader.h > @@ -725,7 +725,8 @@ extern void *efi_bounce_buffer; > #define EFI_LOADER_BOUNCE_BUFFER_SIZE (64 * 1024 * 1024) > #endif > > - > +/* shorten device path */ > +struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp); > struct efi_device_path *efi_dp_next(const struct efi_device_path *dp); > int efi_dp_match(const struct efi_device_path *a, > const struct efi_device_path *b); > diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c > index dc787b4d3d..ddd5f132ec 100644 > --- a/lib/efi_loader/efi_device_path.c > +++ b/lib/efi_loader/efi_device_path.c > @@ -122,20 +122,25 @@ int efi_dp_match(const struct efi_device_path *a, > } > } > > -/* > +/** > + * efi_dp_shorten() - shorten device-path > + * > * We can have device paths that start with a USB WWID or a USB Class node, > * and a few other cases which don't encode the full device path with bus > * hierarchy: > * > - * - MESSAGING:USB_WWID > - * - MESSAGING:USB_CLASS > - * - MEDIA:FILE_PATH > - * - MEDIA:HARD_DRIVE > - * - MESSAGING:URI > + * * MESSAGING:USB_WWID > + * * MESSAGING:USB_CLASS > + * * MEDIA:FILE_PATH > + * * MEDIA:HARD_DRIVE > + * * MESSAGING:URI > * > * See UEFI spec (section 3.1.2, about short-form device-paths) > + * > + * @dp: original devie-path > + * @Return: shortened device-path or NULL > */ > -static struct efi_device_path *shorten_path(struct efi_device_path *dp) > +struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp) > { > while (dp) { > /* > @@ -189,7 +194,7 @@ static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path, > } > } > > - obj_dp = shorten_path(efi_dp_next(obj_dp)); > + obj_dp = efi_dp_shorten(efi_dp_next(obj_dp)); > } while (short_path && obj_dp); > } > > -- > 2.34.1 >