From nobody Thu Nov 6 10:16:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540569642007270.26568820492207; Fri, 26 Oct 2018 09:00:42 -0700 (PDT) Received: from localhost ([::1]:60815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4XQ-0001tR-NP for importer@patchew.org; Fri, 26 Oct 2018 12:00:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4Jg-0003tV-QV for qemu-devel@nongnu.org; Fri, 26 Oct 2018 11:46:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG46b-00055S-JE for qemu-devel@nongnu.org; Fri, 26 Oct 2018 11:33:01 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:35693) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gG46b-0004vo-0C; Fri, 26 Oct 2018 11:32:57 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N3Xvv-1fXPaK0qXL-010fOy; Fri, 26 Oct 2018 17:32:11 +0200 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N3Xvv-1fXPaK0qXL-010fOy; Fri, 26 Oct 2018 17:32:11 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 26 Oct 2018 17:31:20 +0200 Message-Id: <20181026153125.24738-16-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181026153125.24738-1-laurent@vivier.eu> References: <20181026153125.24738-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ujcQMLVnNdlA+bT6z6rODRtkZg/zsDEqRdCnz0gVnaZ9/UQrReP yYwtX/6ZZtTkN6YZvVq54IrtX1iqx1Xkwd5t2OJ98jNQ1a4UmWDICn6a7FyQKjgJF7W+Ctn QhTDR0tSekyjaYRLrbiYdL3X6UDp5aoM44K76g4syHvKF2eQxJRCBHixUz5iJDvpc3V9THi BBKc9sIV3voKPz5VYe5HA== X-UI-Out-Filterresults: notjunk:1;V01:K0:mDkSnPqe98M=:915bT4UpaXUVeT5R6liQYf w/dv7Ug2RSxa3KsGn+7+8g4f1ywSgyhZLKn7vYN0GfwmGhQArERISpZTBitmSAY/82mJJmPsB NvNdFf4tNjCK5ssXJsNtv4ZxU3h6e8CLvgCrGYxPKh7ON6DvOHEghV97LQUtR2E6sJxPGbrEZ ZRlftgPq3oJ8N7oFLRto2bVzIkVNDQOsWcxilAaFgKkd69mz/O60aiqy5qkym+i4hnDr7uMY/ 9Bty4ZbNp8mf1y3rtQc1uP1s7RWAf8BuDXeXiuSduAVbuwXcyUw5eMnWDkeJcgB2HdrMFYsxI vOPGdwsLZJqj+TLxiozh3y9lfi1YknPb7Nng/4fj0Z9nHsSJCGrJzacfFvYHyp/5YRuusD7Sk QDnBpWVYTJMnyyAVrNS9S+l2kR3n51RrIXDY6HjJ9GwcySHizBRyu8W3Ztj5QreLn/pYPvpS2 JuOJj0emB9SmQ6hwpmHc7LUwYSCzX1fQK4stbEF0T0+/Aeyk/SL95f+fuoJhrN9vZVtTTCqjH 7FHhGf525pC5VBpO0KCdiFwCDn5lEz3jfF5FGRgSVj2nqarRkJHS0cVsD1dUb9NCdAu4yCzSH CTOXdBv7ZjNZnlzw1rTTha8FTBVxwBEsgRVwSFOGR97Ilorc3IWMoWTq/HkwO/V8CFb9ERV1K RtoS1dDCoMkV+DEU4xVCJs5o1o9hNYzAlmnp1F9m1kIUuvD+OX+edWjILFNP//jnYmbq/OIji qt4DZM7g+prHqIIV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL 15/20] xen: Use the PCI_DEVICE macro 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: Peter Maydell , "Michael S. Tsirkin" , Jason Wang , Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Stefano Stabellini , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Markus Armbruster , Anthony Perard , xen-devel@lists.xenproject.org, Igor Mammedov , Laurent Vivier , Thomas Huth , Fam Zheng , Eduardo Habkost , Riku Voipio , qemu-arm@nongnu.org, Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Laurent Vivier , Max Reitz , Michael Walle , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 TYPE_XEN_PT_DEVICE is a subclass of TYPE_PCI_DEVICE, the clean way to access the PCIDevice pointer is using the PCI_DEVICE() macro. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster Acked-by: Anthony PERARD Acked-by: Michael S. Tsirkin Message-Id: <20180705155811.20366-4-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/xen/xen_pt_config_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index aee31c62bb..47f9010c75 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -358,7 +358,7 @@ static uint64_t xen_pt_get_bar_size(PCIIORegion *r) static XenPTBarFlag xen_pt_bar_reg_parse(XenPCIPassthroughState *s, int index) { - PCIDevice *d =3D &s->dev; + PCIDevice *d =3D PCI_DEVICE(s); XenPTRegion *region =3D NULL; PCIIORegion *r; =20 @@ -469,7 +469,7 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState = *s, XenPTReg *cfg_entry, { XenPTRegInfo *reg =3D cfg_entry->reg; XenPTRegion *base =3D NULL; - PCIDevice *d =3D &s->dev; + PCIDevice *d =3D PCI_DEVICE(s); const PCIIORegion *r; uint32_t writable_mask =3D 0; uint32_t bar_emu_mask =3D 0; @@ -543,7 +543,7 @@ static int xen_pt_exp_rom_bar_reg_write(XenPCIPassthrou= ghState *s, { XenPTRegInfo *reg =3D cfg_entry->reg; XenPTRegion *base =3D NULL; - PCIDevice *d =3D (PCIDevice *)&s->dev; + PCIDevice *d =3D PCI_DEVICE(s); uint32_t writable_mask =3D 0; uint32_t throughable_mask =3D get_throughable_mask(s, reg, valid_mask); pcibus_t r_size =3D 0; @@ -1587,7 +1587,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughSta= te *s, const XenPTRegGroupInfo *grp_reg, uint32_t base_offset, uint8_t *size) { - PCIDevice *d =3D &s->dev; + PCIDevice *d =3D PCI_DEVICE(s); uint8_t version =3D get_capability_version(s, base_offset); uint8_t type =3D get_device_type(s, base_offset); uint8_t pcie_size =3D 0; --=20 2.17.2