From: Philippe Mathieu-Daudé Date: Wed, 25 Mar 2026 14:43:15 +0000 (+0100) Subject: hw/core: Move compat_props_add() to 'hw/core/boards.h' X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c459df2fc2dd831d43a456e8505e156bbf7cf656;p=thirdparty%2Fqemu.git hw/core: Move compat_props_add() to 'hw/core/boards.h' compat_props_add() is only used by board models, no need to expose it to any device model. Restrict by defining it only in "hw/core/boards.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Message-Id: <20260325151728.45378-3-philmd@linaro.org> --- diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index 9d4ccd1c1c..89388530fd 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -803,6 +803,16 @@ struct MachineState { } \ } while (0) +static inline void +compat_props_add(GPtrArray *arr, + GlobalProperty props[], size_t nelem) +{ + int i; + for (i = 0; i < nelem; i++) { + g_ptr_array_add(arr, (void *)&props[i]); + } +} + extern GlobalProperty hw_compat_11_0[]; extern const size_t hw_compat_11_0_len; diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index f99a8979cc..778617787c 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -421,16 +421,6 @@ typedef struct GlobalProperty { bool optional; } GlobalProperty; -static inline void -compat_props_add(GPtrArray *arr, - GlobalProperty props[], size_t nelem) -{ - int i; - for (i = 0; i < nelem; i++) { - g_ptr_array_add(arr, (void *)&props[i]); - } -} - /*** Board API. This should go away once we have a machine config file. ***/ /**