[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/9] hw/sysbus: Use sizeof(BusState) in main_system_bus_create()
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>
- From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@xxxxxxxxxx>
- Date: Mon, 27 Jan 2025 06:21:00 +0000
- Accept-language: en-GB, fr-FR, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BBWPPFO0UvFY6u15cvi/CxrwzvN6Ekt0rsISfzh5XrA=; b=UOvy8QeJSTuJr5zpPvRIzNjb8SbnH3WyHefoKbn9HqQ2kl70OHbQr9uQREKWpkAg6WcNrkzA1g6v65rfHkhcoBw0gs+G8eqsBkPtc53QSGjq3VZ3BRzSndOnHo3OhFmYvHuHzqTXuwfccvhEML27wW0w8hBI3j93ZhjKoLUvG3ELo9wgzeIyRlpqAmc3+AetX9dZxXizRM5LNTneoIgSIk6+G/qDc5GADUYIj3tN+cozHgN/AE0flGqMXL1kyh5wNM+Q7FOlzfpRNrqoGrZLbbKJBj1XOY+poU7EjWodNfK7Lqd4TsscSvy1Icgw+oF2SgjjmU6czMjVGMIddCyd5A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ENdvjzBmNm4Ugt3b81/uw8p6HCYIRQcAS8J75S10n+1b1UntpGSn3FksIlROpSuKzca5pRuGmXZsk7RG8BzewUKsJHDOz+fCunnEp9DRGBI+gwK0ifT4763EGlLk7BZfq1GwnMza8TO1kSoNZjg/ZLb5fisDfSkq6I9oRzXFAQpquuycdSVi4dYnwD4ZuVykySUtYq8H6OgQM5Kz+A4JCztVOVnBX5NQ4mw8yPGAPQCTW8IwXnfqBZf81C9HJwalvZ7CYw1jRAXNY/9DVkGnYdHjfThaRt2wH1Qrr+Xh77ea/EyoNpmkiSfJTbAsBdOo80pcnikSKauwsa/82xaY3w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com;
- Cc: Yi Liu <yi.l.liu@xxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Gustavo Romero <gustavo.romero@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, "qemu-ppc@xxxxxxxxxx" <qemu-ppc@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Alexander Graf <graf@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Stefan Berger <stefanb@xxxxxxxxxxxxxxxxxx>, Bernhard Beschow <shentey@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Daniel P. Berrangé <berrange@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Cédric Le Goater <clg@xxxxxxxxxx>
- Delivery-date: Mon, 27 Jan 2025 06:21:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHbb1TlTWpZ6ZKzUUKEk8GitOblK7MqKIQA
- Thread-topic: [PATCH 1/9] hw/sysbus: Use sizeof(BusState) in main_system_bus_create()
Reviewed-by: Clément Mathieu--Drif<clement.mathieu--drif@xxxxxxxxxx>
On 25/01/2025 19:13, Philippe Mathieu-Daudé wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> Rather than using the obscure system_bus_info.instance_size,
> directly use sizeof(BusState).
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
> ---
> hw/core/sysbus.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
> index 9355849ff0a..f713bbfe04f 100644
> --- a/hw/core/sysbus.c
> +++ b/hw/core/sysbus.c
> @@ -323,8 +323,8 @@ static void main_system_bus_create(void)
> * assign main_system_bus before qbus_init()
> * in order to make "if (bus != sysbus_get_default())" work
> */
> - main_system_bus = g_malloc0(system_bus_info.instance_size);
> - qbus_init(main_system_bus, system_bus_info.instance_size,
> + main_system_bus = g_new0(BusState, 1);
> + qbus_init(main_system_bus, sizeof(BusState),
> TYPE_SYSTEM_BUS, NULL, "main-system-bus");
> OBJECT(main_system_bus)->free = g_free;
> }
> --
> 2.47.1
>
|