public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [PATCH v2 1/9] efi_loader: export efi_dp_shorten()
Date: Wed, 23 Mar 2022 15:55:32 +0900	[thread overview]
Message-ID: <20220323065532.GB49108@laputa> (raw)
In-Reply-To: <20220319091148.142036-2-heinrich.schuchardt@canonical.com>

On Sat, Mar 19, 2022 at 10:11:40AM +0100, Heinrich Schuchardt wrote:
> From: Heinrich Schuchardt <xypron.glpk@gmx.de>
> 
> 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 <heinrich.schuchardt@canonical.com>
> ---
> 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
> 

  parent reply	other threads:[~2022-03-23  6:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-19  9:11 [PATCH v2 0/9] efi_loader: booting via short-form device-path Heinrich Schuchardt
2022-03-19  9:11 ` [PATCH v2 1/9] efi_loader: export efi_dp_shorten() Heinrich Schuchardt
2022-03-21  7:41   ` Ilias Apalodimas
2022-03-23  6:55   ` AKASHI Takahiro [this message]
2022-03-19  9:11 ` [PATCH v2 2/9] efi_loader: fix efi_dp_find_obj() Heinrich Schuchardt
2022-03-23  7:18   ` AKASHI Takahiro
2022-03-19  9:11 ` [PATCH v2 3/9] efi_loader: efi_dp_find_obj() add protocol check Heinrich Schuchardt
2022-03-23  7:26   ` AKASHI Takahiro
2022-03-19  9:11 ` [PATCH v2 4/9] efi_loader: support booting via short-form device-path Heinrich Schuchardt
2022-03-23  7:50   ` AKASHI Takahiro
2022-03-19  9:11 ` [PATCH v2 5/9] efi_loader: use short-form DP for load options Heinrich Schuchardt
2022-03-23  8:18   ` AKASHI Takahiro
2022-03-19  9:11 ` [PATCH v2 6/9] efi_loader: export efi_system_partition_guid Heinrich Schuchardt
2022-03-19  9:11 ` [PATCH v2 7/9] efi_loader: remove efi_disk_is_system_part() Heinrich Schuchardt
2022-03-19  9:11 ` [PATCH v2 8/9] efi_loader: move dtbdump.c, initrddump.c to lib/efi_loader Heinrich Schuchardt
2022-03-23  7:01   ` AKASHI Takahiro
2022-03-19  9:11 ` [PATCH v2 9/9] test: test UEFI boot manager Heinrich Schuchardt
2022-03-25  7:01 ` [PATCH v2 0/9] efi_loader: booting via short-form device-path AKASHI Takahiro
2022-03-25  9:12   ` AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220323065532.GB49108@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox