public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 3/4] boot: fdt: Drop lmb_alloc*() typecasts
Date: Mon, 18 Mar 2024 18:20:49 +0200	[thread overview]
Message-ID: <20240318162049.GG13682@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240318150200.8178-3-marek.vasut+renesas@mailbox.org>

Hi Marek,

Thank you for the patch.

On Mon, Mar 18, 2024 at 04:00:46PM +0100, Marek Vasut wrote:
> The lmb_alloc_base() returns phys_addr_t , map_sysmem() accepts
> phys_addr_t as first parameter. Declare 'addr' as phys_addr_t and
> get rid of the casts.
> 
> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> V2: - Replace $addr with 'addr' to somehow delimit the variable name
> ---
>  boot/image-fdt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/boot/image-fdt.c b/boot/image-fdt.c
> index c2571b22244..c37442c9130 100644
> --- a/boot/image-fdt.c
> +++ b/boot/image-fdt.c
> @@ -162,6 +162,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
>  	void	*of_start = NULL;
>  	phys_addr_t start, size, usable;
>  	char	*fdt_high;
> +	phys_addr_t addr;
>  	phys_addr_t low;
>  	phys_size_t mapsize;
>  	ulong	of_len = 0;
> @@ -186,7 +187,6 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
>  	fdt_high = env_get("fdt_high");
>  	if (fdt_high) {
>  		ulong desired_addr = hextoul(fdt_high, NULL);
> -		ulong addr;
>  
>  		if (desired_addr == ~0UL) {
>  			/* All ones means use fdt in place */
> @@ -224,8 +224,8 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
>  			 * At least part of this DRAM bank is usable, try
>  			 * using it for LMB allocation.
>  			 */
> -			of_start = map_sysmem((ulong)lmb_alloc_base(lmb,
> -				    of_len, 0x1000, usable), of_len);
> +			addr = lmb_alloc_base(lmb, of_len, 0x1000, usable);
> +			of_start = map_sysmem(addr, of_len);
>  			/* Allocation succeeded, use this block. */
>  			if (of_start != NULL)
>  				break;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-03-18 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 15:00 [PATCH v2 1/4] boot: fdt: Change type of env_get_bootm_low() to phys_addr_t Marek Vasut
2024-03-18 15:00 ` [PATCH v2 2/4] boot: fdt: Clean up env_get_bootm_size() Marek Vasut
2024-03-18 16:18   ` Laurent Pinchart
2024-03-20 20:52     ` Marek Vasut
2024-03-20 21:00       ` Laurent Pinchart
2024-03-26 22:19         ` Marek Vasut
2024-03-18 15:00 ` [PATCH v2 3/4] boot: fdt: Drop lmb_alloc*() typecasts Marek Vasut
2024-03-18 16:20   ` Laurent Pinchart [this message]
2024-03-18 15:00 ` [PATCH v2 4/4] boot: fdt: Move usable variable below updated comment Marek Vasut

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=20240318162049.GG13682@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --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