All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Jerome Forissier <jerome.forissier@linaro.org>
Subject: Re: [PATCH v2 2/5] eficonfig: use u16_strsize() to get u16 string buffer size
Date: Tue, 29 Nov 2022 09:14:19 +0200	[thread overview]
Message-ID: <Y4WxS74tY5t7tBHA@hera> (raw)
In-Reply-To: <20221128124509.6939-3-masahisa.kojima@linaro.org>

On Mon, Nov 28, 2022 at 09:45:06PM +0900, Masahisa Kojima wrote:
> Use u16_strsize() to simplify the u16 string buffer
> size calculation.
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> No update since v1.
> 
>  cmd/eficonfig.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
> index 5529edc85e..88d507d04c 100644
> --- a/cmd/eficonfig.c
> +++ b/cmd/eficonfig.c
> @@ -452,8 +452,7 @@ struct efi_device_path *eficonfig_create_device_path(struct efi_device_path *dp_
>  	struct efi_device_path *dp;
>  	struct efi_device_path_file_path *fp;
>  
> -	fp_size = sizeof(struct efi_device_path) +
> -		  ((u16_strlen(current_path) + 1) * sizeof(u16));
> +	fp_size = sizeof(struct efi_device_path) + u16_strsize(current_path);
>  	buf = calloc(1, fp_size + sizeof(END));
>  	if (!buf)
>  		return NULL;
> -- 
> 2.17.1
> 

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

  reply	other threads:[~2022-11-29  7:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 12:45 [PATCH v2 0/5] miscellaneous fixes of eficonfig Masahisa Kojima
2022-11-28 12:45 ` [PATCH v2 1/5] eficonfig: fix going one directory up issue Masahisa Kojima
2022-11-29  7:14   ` Ilias Apalodimas
2022-11-28 12:45 ` [PATCH v2 2/5] eficonfig: use u16_strsize() to get u16 string buffer size Masahisa Kojima
2022-11-29  7:14   ` Ilias Apalodimas [this message]
2022-11-28 12:45 ` [PATCH v2 3/5] efi_loader: utility function to check the variable name is "Boot####" Masahisa Kojima
2022-11-29  7:33   ` Ilias Apalodimas
2022-11-29  9:57     ` Masahisa Kojima
2022-11-28 12:45 ` [PATCH v2 4/5] eficonfig: use efi_get_next_variable_name_int() Masahisa Kojima
2022-11-28 12:45 ` [PATCH v2 5/5] doc:eficonfig: add description for UEFI Secure Boot Configuration Masahisa Kojima

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=Y4WxS74tY5t7tBHA@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=masahisa.kojima@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.