From nobody Fri Dec 19 08:03:55 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; dkim=fail; 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 1530806675252521.3294033426973; Thu, 5 Jul 2018 09:04:35 -0700 (PDT) Received: from localhost ([::1]:53449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb6kE-00009m-AY for importer@patchew.org; Thu, 05 Jul 2018 12:04:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb6eU-0004Rz-El for qemu-devel@nongnu.org; Thu, 05 Jul 2018 11:58:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fb6eT-00057R-FJ for qemu-devel@nongnu.org; Thu, 05 Jul 2018 11:58:38 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:46857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fb6eO-000551-W1; Thu, 05 Jul 2018 11:58:33 -0400 Received: by mail-qt0-x242.google.com with SMTP id h5-v6so7495259qtm.13; Thu, 05 Jul 2018 08:58:32 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id k66-v6sm4049403qkc.86.2018.07.05.08.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 08:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H03p4Tf4TqrUAQvbNZhv9R3wgc4aoBhieQxGlIlZdp0=; b=Zd1a9b2lzHjBC3JptLmQ7ejZd92lVpQpsCGH9wYQ8uSG1AcBrCXVbA1svaBn/mX/rF 3dUZAcEzjTXsyEsMO1swr4qJL1nfxV3mNttHSzxjTZk2hCB9MDQdMr4ISzMuidHQdgjx +1GwwtwYUJ6OkujPbsAgAn5Tbx3hthmJCCL7SrwnkNCjgkum5QqKb531A83/3BaH2ApX /pNQXQHsMlfhvcgbdvHG5xW+RteYXsbC7hGhPz9zFn8rTTqFONKJ+bQ9D8LkiT6qbatx JVL2WabzOD6qxPzBpjk8JOl2u9PpHm2DZ2zabaQ4wgE8AbJpcjX3u9lu/O3nNcrWbsWz vTeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H03p4Tf4TqrUAQvbNZhv9R3wgc4aoBhieQxGlIlZdp0=; b=YvAWwJyGlbQZVRRrGqaaznwRbb9KVLUe/BcjTK81ICBubFierX9iJi2EQczF6m2Aep q4HuECYjK6k3GDIsN8CRdVp1u1xmrCm4KdLtvbMEE9hTOY8Rx2xLOfqQ24pwp6KG7YhB plWNGID+qX0InAZ+ReggwId8NuUK4wwr3kvEUMyowo0QZ3Vlih2TwZQiDFFls+kcI/lo TjuQy8DjosbjmznuodpS6ZSEWzMIKQ15CeNvIgcI2EmC632xrKFbCJnzUelp+/l2pWNQ 3xkuS9+nEWtRp1K4TtRVlo5aV/FBa5AsBPkqdyooBH+MibAp58wzEZPL1tVFUSPUz6+F Uhlg== X-Gm-Message-State: APt69E2p1X1pOoq0HxYIBpgF9+0BYP8+LlIS0MCPgxSVqkLL4P0/lp0a 69NoyDW2amDzGuaxQI08HopUH4KT X-Google-Smtp-Source: AAOMgpcwxKc4NT8U6TZpUxEewTdX/wU0EDG1MBR7h+ocVs/+1qLBz/dq5p5p5ZzL9VtoV1Xgx7CiyQ== X-Received: by 2002:a0c:f20b:: with SMTP id h11-v6mr5684236qvk.190.1530806312238; Thu, 05 Jul 2018 08:58:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org Date: Thu, 5 Jul 2018 12:58:07 -0300 Message-Id: <20180705155811.20366-4-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180705155811.20366-1-f4bug@amsat.org> References: <20180705155811.20366-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v2 3/7] 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: Anthony Perard , "open list:X86" , Stefano Stabellini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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 --- 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.18.0