qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 07/12] target/riscv/cpu.c: add ADD_CPU_QDEV_PROPERTIES_ARR


From: Daniel Henrique Barboza
Subject: Re: [PATCH v7 07/12] target/riscv/cpu.c: add ADD_CPU_QDEV_PROPERTIES_ARRAY() macro
Date: Tue, 15 Aug 2023 18:15:37 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0



On 8/15/23 17:44, Richard Henderson wrote:
On 8/15/23 13:15, Daniel Henrique Barboza wrote:
@@ -1883,6 +1883,13 @@ static void cpu_set_cfg_unavailable(Object *obj, Visitor 
*v,
  }
  #endif
+#define ADD_CPU_QDEV_PROPERTIES_ARRAY(_dev, _array) \
+    do { \
+        for (Property *prop = _array; prop && prop->name; prop++) { \
+            qdev_property_add_static(_dev, prop); \
+        } \
+    } while (0)

Any reason not to make this a proper function?

It was a macro since early versions and remained this way. I don't have
strong feelings in favor or against it.

I assume that you don't fancy this macro usage, and probably for a good reason,
so I guess I'll do another version without macros in this patch and patch 8 
(since
it's a similar macro usage).


Thanks,


Daniel




r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]