qdev-properties.h: Explicitly set the default value for arraylen properties
In DEFINE_PROP_ARRAY, because we use a PropertyInfo (qdev_prop_arraylen) which has a .set_default_value member we will set the field to a default value. That default value will be zero, by the C rule that struct initialization sets unmentioned members to zero if at least one member is initialized. However it's clearer to state it explicitly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1499788408-10096-2-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
6632f6ff96
commit
d9a7b125d6
|
@ -111,6 +111,7 @@ extern const PropertyInfo qdev_prop_link;
|
|||
_arrayfield, _arrayprop, _arraytype) { \
|
||||
.name = (PROP_ARRAY_LEN_PREFIX _name), \
|
||||
.info = &(qdev_prop_arraylen), \
|
||||
.defval.u = 0, \
|
||||
.offset = offsetof(_state, _field) \
|
||||
+ type_check(uint32_t, typeof_field(_state, _field)), \
|
||||
.arrayinfo = &(_arrayprop), \
|
||||
|
|
Loading…
Reference in a new issue