diff mbox series

[3/4] hw/ppc/vof: Simplify LD/ST API uses

Message ID 20240927214531.20242-4-philmd@linaro.org
State New
Headers show
Series hw/ppc & net: Simplify LD/ST API uses | expand

Commit Message

Philippe Mathieu-Daudé Sept. 27, 2024, 9:45 p.m. UTC
Directly call ldn_be_p once instead of be32_to_cpu / ldq_be_p.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/vof.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index b5b6514d79..fb152efbe0 100644
--- a/hw/ppc/vof.c
+++ b/hw/ppc/vof.c
@@ -645,11 +645,7 @@  static void vof_dt_memory_available(void *fdt, GArray *claimed, uint64_t base)
 
     mem0_reg = fdt_getprop(fdt, offset, "reg", &proplen);
     g_assert(mem0_reg && proplen == sizeof(uint32_t) * (ac + sc));
-    if (sc == 2) {
-        mem0_end = ldq_be_p(mem0_reg + sizeof(uint32_t) * ac);
-    } else {
-        mem0_end = be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t) * ac));
-    }
+    mem0_end = ldn_be_p(mem0_reg + sizeof(uint32_t) * ac, 4 * sc);
 
     g_array_sort(claimed, of_claimed_compare_func);
     vof_claimed_dump(claimed);