From patchwork Tue Oct 30 11:23:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 10660729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F241413B5 for ; Tue, 30 Oct 2018 11:39:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E34B62A179 for ; Tue, 30 Oct 2018 11:39:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D62822A17B; Tue, 30 Oct 2018 11:39:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 780D22A179 for ; Tue, 30 Oct 2018 11:39:45 +0000 (UTC) Received: from localhost ([::1]:52335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHSN6-0008MM-PM for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 Oct 2018 07:39:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS9J-0002K4-Hf for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:25:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHS9D-0003lp-Qp for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:25:26 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:33245) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHS95-0003QZ-PS; Tue, 30 Oct 2018 07:25:16 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N4Qbu-1fbGre21f4-011OvM; Tue, 30 Oct 2018 12:24:16 +0100 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N4Qbu-1fbGre21f4-011OvM; Tue, 30 Oct 2018 12:24:16 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:23:32 +0100 Message-Id: <20181030112337.17973-16-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030112337.17973-1-laurent@vivier.eu> References: <20181030112337.17973-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:fEA6fEZUli6katgBcLR2UN6VP+wotM/9GE2n0cKhVL+g9AJJPqS aEsrP3QZQ1Z1kZfwABTc8xuERCj/NZX6+cjgovsZdIKZikW1jEvFAdRcqAE2pUSaG9Uqfvy Cp76U6QMb5PTUhEB7k8fjD0N9Fhk0wzbv+priZDqd4I8trza/F0LUZOaJwXOgxtPSIfO/QS W4/2FmL7pirR1OPGpjE4A== X-UI-Out-Filterresults: notjunk:1;V01:K0:+0dT5Ik5g5A=:wSNQ6JljSuIwB+4s8LSxPs hCo43ZZSo1UY7aDC0Hom3leMsEsPOO6ley0omKGUR68uyRCqgBQZm5nh7Ax6EgwhXcrmedO2C 4KlKvJVDBtK3QsDh56jEsDtlqtx4IIlg4z6hv9iLoVAztOZludyxI1UKODEMrYbnkRh0oNk0S Nr3yA3nqVSqAou0J3Oc7Hrc7j55ax47ssxPoN53YDv+EExIqB7/83/f8mL8376s+gMWdoobe7 WUTTAJI/7b0LWmYVtTwfrMH50CgANP42Y/u6/+6YMfRUmhqHT+pzs/VETsQ4zDt+nYShhY79H FXlhn+pLwzX71R1e43/9R5Kp/Xuw2nooQhoqjocJNL7OQBSh37JdnzIlaswuUUOM8tjjHTVnn 5Kjh75yM3qhRRpm94wZVaCN7enNc+w3AOJJD3cJBcvl4vn6wsJP5AwZdX4A+DTC9FlQb9TgfU sQ2ON/qumkenkEcXAuKIqhwfzyDyGG9M2pS5TRCLz3olCntr4f9KadPG7eRppcZCQ2/yKRF0o HbBed2bjuKd3HbmARIu1pqx9IsygYs8wiwxSimW/24ZcoQ6nVQsAClEmWKV6BS6maVYs7XG1G FwzlVncQ0WyYyT/Azl1xaH+DrguprnXMmY7Pet4nVd3YPSEw6WnVhNn1h11KwSs8rT2RldyiC cGoMDybGtNcAjea7773tlkLWEZYZU+1hyC8KYZSOqvCuCT+2Tnub+D9UMIVfvYCqinLO7K1UG wL18M3gzM+71QJ63 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PULL v2 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Stefano Stabellini , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Michael Walle , Anthony Perard , xen-devel@lists.xenproject.org, Laurent Vivier , Thomas Huth , Fam Zheng , Eduardo Habkost , Riku Voipio , qemu-arm@nongnu.org, Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Kevin Wolf , Markus Armbruster , Laurent Vivier , Max Reitz , Igor Mammedov , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé 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é 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 = &s->dev; + PCIDevice *d = PCI_DEVICE(s); XenPTRegion *region = NULL; PCIIORegion *r; @@ -469,7 +469,7 @@ static int xen_pt_bar_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry, { XenPTRegInfo *reg = cfg_entry->reg; XenPTRegion *base = NULL; - PCIDevice *d = &s->dev; + PCIDevice *d = PCI_DEVICE(s); const PCIIORegion *r; uint32_t writable_mask = 0; uint32_t bar_emu_mask = 0; @@ -543,7 +543,7 @@ static int xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s, { XenPTRegInfo *reg = cfg_entry->reg; XenPTRegion *base = NULL; - PCIDevice *d = (PCIDevice *)&s->dev; + PCIDevice *d = PCI_DEVICE(s); uint32_t writable_mask = 0; uint32_t throughable_mask = get_throughable_mask(s, reg, valid_mask); pcibus_t r_size = 0; @@ -1587,7 +1587,7 @@ static int xen_pt_pcie_size_init(XenPCIPassthroughState *s, const XenPTRegGroupInfo *grp_reg, uint32_t base_offset, uint8_t *size) { - PCIDevice *d = &s->dev; + PCIDevice *d = PCI_DEVICE(s); uint8_t version = get_capability_version(s, base_offset); uint8_t type = get_device_type(s, base_offset); uint8_t pcie_size = 0;