All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Sean Edmond <seanedmond@microsoft.com>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Jerry Van Baren <vanbaren@cideas.com>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Safae Ouajih <souajih@baylibre.com>
Subject: [PATCH 6/7] fdt: Drop the confusing casts in lmb_free()
Date: Sun, 12 Nov 2023 08:27:49 -0700	[thread overview]
Message-ID: <20231112152754.130399-7-sjg@chromium.org> (raw)
In-Reply-To: <20231112152754.130399-1-sjg@chromium.org>

Just use map_to_sysmem() instead of all the casting.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 boot/image-fdt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index ac7dc055cc9c..3e889be9f2b6 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -685,8 +685,7 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob,
 
 	/* Delete the old LMB reservation */
 	if (lmb)
-		lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
-			 (phys_size_t)fdt_totalsize(blob));
+		lmb_free(lmb, map_to_sysmem(blob), fdt_totalsize(blob));
 
 	ret = fdt_shrink_to_minimum(blob, 0);
 	if (ret < 0)
@@ -695,7 +694,7 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob,
 
 	/* Create a new LMB reservation */
 	if (lmb)
-		lmb_reserve(lmb, (ulong)blob, of_size);
+		lmb_reserve(lmb, map_to_sysmem(blob), of_size);
 
 	if (!ft_verify_fdt(blob))
 		goto err;
-- 
2.42.0.869.gea05f2083d-goog


  parent reply	other threads:[~2023-11-12 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12 15:27 [PATCH 0/7] fdt: Move towards using ofnode for devicetree fixups Simon Glass
2023-11-12 15:27 ` [PATCH 1/7] boot: Drop size parameter from image_setup_libfdt() Simon Glass
2023-11-12 18:22   ` Tom Rini
2023-12-13 20:39   ` Simon Glass
2023-11-12 15:27 ` [PATCH 2/7] fdt: Check for a valid fdt in oftree_ensure() Simon Glass
2023-11-12 15:27 ` [PATCH 3/7] fdt: Improve the comment for fdt_shrink_to_minimum() Simon Glass
2023-11-12 15:27 ` [PATCH 4/7] fdt: ppc: Drop extra size for ramdisk Simon Glass
2023-11-12 18:22   ` Tom Rini
2023-12-13 20:39   ` Simon Glass
2023-11-12 15:27 ` [PATCH 5/7] boot: Move adding initrd earlier in image_setup_libfdt() Simon Glass
2023-11-12 15:27 ` Simon Glass [this message]
2023-11-12 15:27 ` [PATCH 7/7] fdt: Move ft_verify_fdt() before the final fixups Simon Glass
2023-12-13 20:39 ` [PATCH 6/7] fdt: Drop the confusing casts in lmb_free() Simon Glass
2023-12-13 20:39 ` [PATCH 5/7] boot: Move adding initrd earlier in image_setup_libfdt() Simon Glass

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=20231112152754.130399-7-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=mkorpershoek@baylibre.com \
    --cc=seanedmond@microsoft.com \
    --cc=souajih@baylibre.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vanbaren@cideas.com \
    /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.