From fa386d989d0bec0abdcd1a883853071928adcced Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 12 Dec 2018 16:30:28 +0400 Subject: machines: replace COMPAT define with a static array Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov Reviewed-by: Cornelia Huck Acked-by: Eduardo Habkost --- include/hw/boards.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/hw/boards.h b/include/hw/boards.h index 362384815e..a5d8ddd68b 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -289,18 +289,14 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) -#define SET_MACHINE_COMPAT(m, COMPAT) \ +#define SET_MACHINE_COMPAT(m, compat) \ do { \ int i; \ - static GlobalProperty props[] = { \ - COMPAT \ - { /* end of list */ } \ - }; \ if (!m->compat_props) { \ m->compat_props = g_array_new(false, false, sizeof(void *)); \ } \ - for (i = 0; props[i].driver != NULL; i++) { \ - GlobalProperty *prop = &props[i]; \ + for (i = 0; i < G_N_ELEMENTS(compat); i++) { \ + GlobalProperty *prop = &compat[i]; \ g_array_append_val(m->compat_props, prop); \ } \ } while (0) -- cgit v1.2.3-55-g7522