From nobody Sun Feb 8 19:25:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556376465; cv=none; d=zoho.com; s=zohoarc; b=ZMDwkx8Ll26YYrb0vHtsyYRl0FT2maXQh/oGyghvq2tNyOVWoq6K4XFwcqyCrlTRIwAOil1Yi6G7GZUls92qE/hppXVZhs5uJbUayYoWC0eM9WWitATm6wezprhHUJ2GJliQJ+v8COXDg67ZPzxF5mNK6nkcZnUqnimTp5AX1WA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556376465; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=y0RbpHsKXfBe3+s35TFH6k4LseHLW/mNgbCw0nS5zHc=; b=I2mFUvRU55fuiQrb/vRlIHxQqWegKNH7S23jClRbK3kCcfEDS0knEMRWOupl/2F/pjYPgVk1AVJ+TCNWqx5evv0vFoQsN6QkxHbICvXY1RYBOtcOIAgGkFYtLJiLwLB4i/obM0qu98rOipxw62LbLEYv0SE05MSSHRNbAjUYujc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15563764654330.13763381718058554; Sat, 27 Apr 2019 07:47:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:32908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOc9-0007Vh-Ec for importer@patchew.org; Sat, 27 Apr 2019 10:47:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOZp-0005dm-J0 for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKOVM-0004ok-4K for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKOVL-0004mS-VE for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B4A1882F5; Sat, 27 Apr 2019 14:40:39 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-83.brq.redhat.com [10.40.204.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 737191001E81; Sat, 27 Apr 2019 14:40:36 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Sat, 27 Apr 2019 16:40:23 +0200 Message-Id: <20190427144025.22880-2-philmd@redhat.com> In-Reply-To: <20190427144025.22880-1-philmd@redhat.com> References: <20190427144025.22880-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 27 Apr 2019 14:40:39 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/3] hw/acpi/piix4: Move TYPE_PIIX4_PM to a public header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Thomas Huth , Samuel Ortiz , "Michael S. Tsirkin" , Igor Mammedov , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Move the TYPE_PIIX4_PM definition to the corresponding header, so other files can use it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/piix4.c | 2 -- include/hw/acpi/piix4.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 9c079d68341..160e7308c51 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -92,8 +92,6 @@ typedef struct PIIX4PMState { MemHotplugState acpi_memory_hotplug; } PIIX4PMState; =20 -#define TYPE_PIIX4_PM "PIIX4_PM" - #define PIIX4_PM(obj) \ OBJECT_CHECK(PIIX4PMState, (obj), TYPE_PIIX4_PM) =20 diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 26c2370e308..57d7e1cda20 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -1,6 +1,8 @@ #ifndef HW_ACPI_PIIX4_H #define HW_ACPI_PIIX4_H =20 +#define TYPE_PIIX4_PM "PIIX4_PM" + Object *piix4_pm_find(void); =20 #endif --=20 2.20.1 From nobody Sun Feb 8 19:25:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556376588; cv=none; d=zoho.com; s=zohoarc; b=Wl9eBy06DG76vXEbPb2UHsFbZB/p3lRBeNfPTzM36qjK0cuZ3SzeISBQ5PAVy4JmRqc5q/fNtxknb5fAniSfy9ls7uBu1aleeirWLU3QxvKmMXhrPCbqvwyuupYa+3irwNs9xNGpwjyTpmzZupjS8Cvg7UM3mIOVBIyPrT19nbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556376588; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=61CnfRYlGV3Dr/jh9OSzFcCn7db0Yy0VAOrmEbKO2RQ=; b=nc40SXFfGcHbdCz14bKX+vI2h+7UMJcFlb37WIjXRT7MheVgYvLWWhnaFGw6gY/jMdjVzA4hDNdLXaXO2brl6FV9arXl18hUarSJ2GuQd7vGVrRUxB7Rc+WHTnZMDjdIwNW/NmowDLlGX66QwzusP0ZiYJ1I5t1Wt/rgF5nnpNo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556376588965821.0459925208676; Sat, 27 Apr 2019 07:49:48 -0700 (PDT) Received: from localhost ([127.0.0.1]:32948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOeC-00010O-2u for importer@patchew.org; Sat, 27 Apr 2019 10:49:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOZo-0005eR-R8 for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKOVQ-0004v7-1V for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53422) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKOVP-0004rn-PX for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:43 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A741307EA81; Sat, 27 Apr 2019 14:40:42 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-83.brq.redhat.com [10.40.204.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B50E61001E81; Sat, 27 Apr 2019 14:40:39 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Sat, 27 Apr 2019 16:40:24 +0200 Message-Id: <20190427144025.22880-3-philmd@redhat.com> In-Reply-To: <20190427144025.22880-1-philmd@redhat.com> References: <20190427144025.22880-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 27 Apr 2019 14:40:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] hw/i386/acpi: Add object_resolve_type_unambiguous to improve modularity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Thomas Huth , Samuel Ortiz , "Michael S. Tsirkin" , Igor Mammedov , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When building with CONFIG_Q35=3Dn, we get: LINK x86_64-softmmu/qemu-system-x86_64 /usr/bin/ld: hw/i386/acpi-build.o: in function `acpi_get_misc_info': /source/qemu/hw/i386/acpi-build.c:243: undefined reference to `ich9_lpc_f= ind' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1 This is due to a dependency in acpi-build.c on the ICH9_LPC (via ich9_lpc_find) and PIIX4_PM (via piix4_pm_find) devices. To allow better modularity (compile acpi-build.c with only Q35/ICH9 or ISAPC/PIIX4), refactor the similar helper as object_resolve_type_unambiguous(). This way we relax the linker dependencies and can build the x86 targets with a selection of machines (instead of all of them). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/piix4.c | 11 ----------- hw/i386/acpi-build.c | 20 ++++++++++++++++---- hw/isa/lpc_ich9.c | 11 ----------- include/hw/acpi/piix4.h | 2 -- include/hw/i386/ich9.h | 2 -- 5 files changed, 16 insertions(+), 30 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 160e7308c51..c903e651695 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -552,17 +552,6 @@ static void piix4_pm_realize(PCIDevice *dev, Error **e= rrp) piix4_pm_add_propeties(s); } =20 -Object *piix4_pm_find(void) -{ - bool ambig; - Object *o =3D object_resolve_path_type("", TYPE_PIIX4_PM, &ambig); - - if (ambig || !o) { - return NULL; - } - return o; -} - I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, qemu_irq sci_irq, qemu_irq smi_irq, int smm_enabled, DeviceState **piix4_pm) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 416da318ae0..123ff2b8169 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -35,6 +35,7 @@ #include "hw/acpi/acpi-defs.h" #include "hw/acpi/acpi.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/piix4.h" #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/loader.h" @@ -164,10 +165,21 @@ static void init_common_fadt_data(Object *o, AcpiFadt= Data *data) *data =3D fadt; } =20 +static Object *object_resolve_type_unambiguous(const char *typename) +{ + bool ambig; + Object *o =3D object_resolve_path_type("", typename, &ambig); + + if (ambig || !o) { + return NULL; + } + return o; +} + static void acpi_get_pm_info(AcpiPmInfo *pm) { - Object *piix =3D piix4_pm_find(); - Object *lpc =3D ich9_lpc_find(); + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); Object *obj =3D piix ? piix : lpc; QObject *o; pm->cpu_hp_io_base =3D 0; @@ -228,8 +240,8 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) =20 static void acpi_get_misc_info(AcpiMiscInfo *info) { - Object *piix =3D piix4_pm_find(); - Object *lpc =3D ich9_lpc_find(); + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); assert(!!piix !=3D !!lpc); =20 if (piix) { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index ac44aa53bee..031ee9cd933 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -624,17 +624,6 @@ static const MemoryRegionOps ich9_rst_cnt_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN }; =20 -Object *ich9_lpc_find(void) -{ - bool ambig; - Object *o =3D object_resolve_path_type("", TYPE_ICH9_LPC_DEVICE, &ambi= g); - - if (ambig) { - return NULL; - } - return o; -} - static void ich9_lpc_get_sci_int(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 57d7e1cda20..028bb53e3df 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -3,6 +3,4 @@ =20 #define TYPE_PIIX4_PM "PIIX4_PM" =20 -Object *piix4_pm_find(void); - #endif diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 673d13d28f2..046bcf33bed 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -81,8 +81,6 @@ typedef struct ICH9LPCState { qemu_irq gsi[GSI_NUM_PINS]; } ICH9LPCState; =20 -Object *ich9_lpc_find(void); - #define Q35_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) =20 --=20 2.20.1 From nobody Sun Feb 8 19:25:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556376591; cv=none; d=zoho.com; s=zohoarc; b=GA6JF7YQFQIfrPVm/Bif3+Xl6VaQDJFg8qpnB5oxc0hcrP6cCDTx8NC8/OOTy/ZGbPTYVpWtYommPyczNhkGYEwz4f/T252mhZf0g9WL1ZXqvNgfOOiDfuD6MA7pGe6uNnDYIghuP47XWlHyyaq3RBqL1viAlD7rAWzabXTA8IE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556376591; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BF454sqzOietndOPZK1H6u5obBYpxUiRacHAty96OKY=; b=A6AOhHD6ym/INgAfDOc7xAba9EycW0/1Imj9mR360g+orGkn8qLtt8sIoWYrxC+a2pv0PgST26SvvRsnSzn+rPRAVSjr/jeBl3TH5WEWJ1WSgokR8VV/uTnzVkmB+Rik7jfuVmeyDapUtEGq6ZIWuumDjPSFjT4V8+muaBG2ldU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556376591187718.3595723579894; Sat, 27 Apr 2019 07:49:51 -0700 (PDT) Received: from localhost ([127.0.0.1]:32944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOeC-00010K-85 for importer@patchew.org; Sat, 27 Apr 2019 10:49:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKOZo-0005eO-QV for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKOVU-00053F-Nk for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hKOVT-0004yf-NF for qemu-devel@nongnu.org; Sat, 27 Apr 2019 10:40:47 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5AC4368B1; Sat, 27 Apr 2019 14:40:45 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-83.brq.redhat.com [10.40.204.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC04D1001E81; Sat, 27 Apr 2019 14:40:42 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Sat, 27 Apr 2019 16:40:25 +0200 Message-Id: <20190427144025.22880-4-philmd@redhat.com> In-Reply-To: <20190427144025.22880-1-philmd@redhat.com> References: <20190427144025.22880-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 27 Apr 2019 14:40:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/3] hw/i386/acpi: Assert a pointer is not null BEFORE using it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhong , Thomas Huth , Samuel Ortiz , "Michael S. Tsirkin" , Igor Mammedov , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Commit 72c194f7e75c added a non-null check on the 'obj' pointer. Later, commit 500b11ea5095 added code which uses the 'obj' pointer _before_ the assertion check. Move the assertion _before_ the pointer use. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 123ff2b8169..b4ec14e349f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -186,6 +186,7 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) pm->pcihp_io_base =3D 0; pm->pcihp_io_len =3D 0; =20 + assert(obj); init_common_fadt_data(obj, &pm->fadt); if (piix) { /* w2k requires FADT(rev1) or it won't boot, keep PC compatible */ @@ -204,7 +205,6 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) pm->fadt.flags |=3D 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base =3D ICH9_CPU_HOTPLUG_IO_BASE; } - assert(obj); =20 /* The above need not be conditional on machine type because the reset= port * happens to be the same on PIIX (pc) and ICH9 (q35). */ --=20 2.20.1