@@ -1922,6 +1922,8 @@ static Property riscv_cpu_options[] = {
DEFINE_PROP_UINT16("cbom_blocksize", RISCVCPU, cfg.cbom_blocksize, 64),
DEFINE_PROP_UINT16("cboz_blocksize", RISCVCPU, cfg.cboz_blocksize, 64),
+
+ DEFINE_PROP_END_OF_LIST(),
};
#ifdef CONFIG_KVM
@@ -1971,12 +1973,12 @@ void kvm_riscv_cpu_add_kvm_properties(Object *obj)
riscv_cpu_add_kvm_unavail_prop(obj, prop->name);
}
- for (int i = 0; i < ARRAY_SIZE(riscv_cpu_options); i++) {
+ for (prop = riscv_cpu_options; prop && prop->name; prop++) {
/* Check if KVM created the property already */
- if (object_property_find(obj, riscv_cpu_options[i].name)) {
+ if (object_property_find(obj, prop->name)) {
continue;
}
- qdev_property_add_static(dev, &riscv_cpu_options[i]);
+ qdev_property_add_static(dev, prop);
}
}
#endif
@@ -2007,8 +2009,8 @@ static void riscv_cpu_add_user_properties(Object *obj)
qdev_property_add_static(dev, prop);
}
- for (int i = 0; i < ARRAY_SIZE(riscv_cpu_options); i++) {
- qdev_property_add_static(dev, &riscv_cpu_options[i]);
+ for (prop = riscv_cpu_options; prop && prop->name; prop++) {
+ qdev_property_add_static(dev, prop);
}
}