[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/5] hw/core: use qemu_fdt_setprop_strings()
From: |
Ben Dooks |
Subject: |
[PATCH v3 3/5] hw/core: use qemu_fdt_setprop_strings() |
Date: |
Wed, 27 Jul 2022 23:39:03 +0100 |
Change to using the qemu_fdt_setprop_strings() helper in
hw/core code.
Signed-off-by: Ben Dooks <qemu@ben.fluff.org>
---
hw/core/guest-loader.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/core/guest-loader.c b/hw/core/guest-loader.c
index 391c875a29..203090503e 100644
--- a/hw/core/guest-loader.c
+++ b/hw/core/guest-loader.c
@@ -56,10 +56,8 @@ static void loader_insert_platform_data(GuestLoaderState *s,
int size,
qemu_fdt_setprop(fdt, node, "reg", ®_attr, sizeof(reg_attr));
if (s->kernel) {
- const char *compat[2] = { "multiboot,module", "multiboot,kernel" };
- if (qemu_fdt_setprop_string_array(fdt, node, "compatible",
- (char **) &compat,
- ARRAY_SIZE(compat)) < 0) {
+ if (qemu_fdt_setprop_strings(fdt, node, "compatible",
+ "multiboot,module", "multiboot,kernel") <
0) {
error_setg(errp, "couldn't set %s/compatible", node);
return;
}
@@ -69,10 +67,8 @@ static void loader_insert_platform_data(GuestLoaderState *s,
int size,
}
}
} else if (s->initrd) {
- const char *compat[2] = { "multiboot,module", "multiboot,ramdisk" };
- if (qemu_fdt_setprop_string_array(fdt, node, "compatible",
- (char **) &compat,
- ARRAY_SIZE(compat)) < 0) {
+ if (qemu_fdt_setprop_strings(fdt, node, "compatible",
+ "multiboot,module", "multiboot,ramdisk")
< 0) {
error_setg(errp, "couldn't set %s/compatible", node);
return;
}
--
2.35.1
- add qemu_fdt_setprop_strings() and use it in most places, Ben Dooks, 2022/07/27
- [PATCH v3 4/5] hw/mips: use qemu_fdt_setprop_strings(), Ben Dooks, 2022/07/27
- [PATCH v3 1/5] device_tree: add qemu_fdt_setprop_strings() helper, Ben Dooks, 2022/07/27
- [PATCH v3 3/5] hw/core: use qemu_fdt_setprop_strings(),
Ben Dooks <=
- [PATCH v3 2/5] hw/riscv: use qemu_fdt_setprop_strings() for string arrays, Ben Dooks, 2022/07/27
- [PATCH v3 5/5] hw/arm: change to use qemu_fdt_setprop_strings(), Ben Dooks, 2022/07/27
- Re: add qemu_fdt_setprop_strings() and use it in most places, Ben Dooks, 2022/07/27