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 --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);
--
2.45.2