[PATCH 6/7] fdt: Drop the confusing casts in lmb_free()
Simon Glass
sjg at chromium.org
Sun Nov 12 16:27:49 CET 2023
Just use map_to_sysmem() instead of all the casting.
Signed-off-by: Simon Glass <sjg at 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
More information about the U-Boot
mailing list