Re: add qemu_fdt_setprop_strings

2022-10-24 Thread Ben Dooks
On 21/10/2022 08:00, Andrew Jones wrote: On Fri, Oct 21, 2022 at 06:58:02AM +0100, Ben Dooks wrote: Add a qemu_fdt_setprop_strings to set a string array into a device-tree. Only minor updates from v4 to fix a couple of minor patch issues. Please see the comments I made on patch 1 of the v4 se

Re: add qemu_fdt_setprop_strings

2022-10-21 Thread Philippe Mathieu-Daudé
On 21/10/22 09:00, Andrew Jones wrote: On Fri, Oct 21, 2022 at 06:58:02AM +0100, Ben Dooks wrote: Add a qemu_fdt_setprop_strings to set a string array into a device-tree. Only minor updates from v4 to fix a couple of minor patch issues. Please see the comments I made on patch 1 of the v4 seri

Re: add qemu_fdt_setprop_strings

2022-10-21 Thread Andrew Jones
On Fri, Oct 21, 2022 at 06:58:02AM +0100, Ben Dooks wrote: > Add a qemu_fdt_setprop_strings to set a string array into a device-tree. > > Only minor updates from v4 to fix a couple of minor patch issues. Please see the comments I made on patch 1 of the v4 series, they should be addressed. Also, I

Re: [PATCH v5 1/6] device_tree: add qemu_fdt_setprop_strings() helper

2022-10-20 Thread Andrew Jones
On Fri, Oct 21, 2022 at 06:58:03AM +0100, Ben Dooks wrote: > Add a helper to set a property from a set of strings > to reduce the following code: > > static const char * const clint_compat[2] = { > "sifive,clint0", "riscv,clint0" > }; > > qemu_fdt_setprop_string_array(fdt, nod

add qemu_fdt_setprop_strings

2022-10-20 Thread Ben Dooks
Add a qemu_fdt_setprop_strings to set a string array into a device-tree. Only minor updates from v4 to fix a couple of minor patch issues.

[PATCH v5 1/6] device_tree: add qemu_fdt_setprop_strings() helper

2022-10-20 Thread Ben Dooks
Add a helper to set a property from a set of strings to reduce the following code: static const char * const clint_compat[2] = { "sifive,clint0", "riscv,clint0" }; qemu_fdt_setprop_string_array(fdt, nodename, "compatible", (char **)&clint_compat, ARRAY_SIZE(clint_compa

Re: add qemu_fdt_setprop_strings() and use it in most places

2022-08-12 Thread Peter Maydell
On Tue, 9 Aug 2022 at 19:57, Ben Dooks wrote: > > Add a helper for qemu_fdt_setprop_strings() to take a set of strings > to put into a device-tree, which removes several open-coded methods > such as setting an char arr[] = {..} or setting char val[] = "str\0str2"; > > This is for hw/arm, hw/mips a

Re: [PATCH v3 1/5] device_tree: add qemu_fdt_setprop_strings() helper

2022-08-10 Thread Andrew Jones
On Thu, Jul 28, 2022 at 11:22:27AM +0200, Andrew Jones wrote: > On Wed, Jul 27, 2022 at 11:39:01PM +0100, Ben Dooks wrote: > > Add a helper to set a property from a set of strings > > to reduce the following code: > > > > static const char * const clint_compat[2] = { > > "sifive,clint0

Re: [PATCH v4 1/6] device_tree: add qemu_fdt_setprop_strings() helper

2022-08-10 Thread Andrew Jones
On Tue, Aug 09, 2022 at 07:56:35PM +0100, Ben Dooks wrote: > Add a helper to set a property from a set of strings > to reduce the following code: > > static const char * const clint_compat[2] = { > "sifive,clint0", "riscv,clint0" > }; > > qemu_fdt_setprop_string_array(fdt, nod

Re: add qemu_fdt_setprop_strings() and use it in most places

2022-08-09 Thread Ben Dooks
On Tue, Aug 09, 2022 at 07:56:34PM +0100, Ben Dooks wrote: > Add a helper for qemu_fdt_setprop_strings() to take a set of strings > to put into a device-tree, which removes several open-coded methods > such as setting an char arr[] = {..} or setting char val[] = "str\0str2"; > > > This is

[PATCH v4 1/6] device_tree: add qemu_fdt_setprop_strings() helper

2022-08-09 Thread Ben Dooks
Add a helper to set a property from a set of strings to reduce the following code: static const char * const clint_compat[2] = { "sifive,clint0", "riscv,clint0" }; qemu_fdt_setprop_string_array(fdt, nodename, "compatible", (char **)&clint_compat, ARRAY_SIZE(clint_compa

add qemu_fdt_setprop_strings() and use it in most places

2022-08-09 Thread Ben Dooks
Add a helper for qemu_fdt_setprop_strings() to take a set of strings to put into a device-tree, which removes several open-coded methods such as setting an char arr[] = {..} or setting char val[] = "str\0str2"; This is for hw/arm, hw/mips and hw/riscv as well as a couple of cores. It is not

Re: [PATCH v3 1/5] device_tree: add qemu_fdt_setprop_strings() helper

2022-07-28 Thread Ben Dooks
On Thu, Jul 28, 2022 at 11:22:27AM +0200, Andrew Jones wrote: > On Wed, Jul 27, 2022 at 11:39:01PM +0100, Ben Dooks wrote: > > Add a helper to set a property from a set of strings > > to reduce the following code: > > > > static const char * const clint_compat[2] = { > > "sifive,clint0

Re: [PATCH v3 1/5] device_tree: add qemu_fdt_setprop_strings() helper

2022-07-28 Thread Andrew Jones
On Wed, Jul 27, 2022 at 11:39:01PM +0100, Ben Dooks wrote: > Add a helper to set a property from a set of strings > to reduce the following code: > > static const char * const clint_compat[2] = { > "sifive,clint0", "riscv,clint0" > }; > > qemu_fdt_setprop_string_array(fdt, nod

Re: add qemu_fdt_setprop_strings() and use it in most places

2022-07-27 Thread Ben Dooks
On Wed, Jul 27, 2022 at 11:39:00PM +0100, Ben Dooks wrote: > Add a helper for qemu_fdt_setprop_strings() to take a set of strings > to put into a device-tree, which removes several open-coded methods > such as setting an char arr[] = {..} or setting char val[] = "str\0str2"; > > This is for hw/arm

add qemu_fdt_setprop_strings() and use it in most places

2022-07-27 Thread Ben Dooks
Add a helper for qemu_fdt_setprop_strings() to take a set of strings to put into a device-tree, which removes several open-coded methods such as setting an char arr[] = {..} or setting char val[] = "str\0str2"; This is for hw/arm, hw/mips and hw/riscv as well as a couple of cores. It is not fully

[PATCH v3 1/5] device_tree: add qemu_fdt_setprop_strings() helper

2022-07-27 Thread Ben Dooks
Add a helper to set a property from a set of strings to reduce the following code: static const char * const clint_compat[2] = { "sifive,clint0", "riscv,clint0" }; qemu_fdt_setprop_string_array(fdt, nodename, "compatible", (char **)&clint_compat, ARRAY_SIZE(clint_compa

Re: [PATCH 3/4] device_tree: add qemu_fdt_setprop_strings() helper

2022-06-19 Thread Alistair Francis
On Sun, Jun 19, 2022 at 6:20 AM Ben Dooks wrote: > > Add a helper to set a property from a set of strings > to reduce the following code: > > static const char * const clint_compat[2] = { > "sifive,clint0", "riscv,clint0" > }; > > qemu_fdt_setprop_string_array(fdt, nodename, "c

[PATCH 3/4] device_tree: add qemu_fdt_setprop_strings() helper

2022-06-18 Thread Ben Dooks
Add a helper to set a property from a set of strings to reduce the following code: static const char * const clint_compat[2] = { "sifive,clint0", "riscv,clint0" }; qemu_fdt_setprop_string_array(fdt, nodename, "compatible", (char **)&clint_compat, ARRAY_SIZE(clint_compa

Re: [PATCH 3/4] device_tree: add qemu_fdt_setprop_strings() helper

2022-04-19 Thread Alistair Francis
On Mon, Apr 18, 2022 at 7:14 AM Ben Dooks wrote: > > Add a helper to set a property from a set of strings > to reduce the following code: > > static const char * const clint_compat[2] = { > "sifive,clint0", "riscv,clint0" > }; > > qemu_fdt_setprop_string_array(fdt, nodename, "c

[PATCH 3/4] device_tree: add qemu_fdt_setprop_strings() helper

2022-04-17 Thread Ben Dooks
Add a helper to set a property from a set of strings to reduce the following code: static const char * const clint_compat[2] = { "sifive,clint0", "riscv,clint0" }; qemu_fdt_setprop_string_array(fdt, nodename, "compatible", (char **)&clint_compat, ARRAY_SIZE(clint_compa