From patchwork Tue Jan 2 09:28:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Jaggi X-Patchwork-Id: 123103 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8755124qgn; Tue, 2 Jan 2018 01:31:15 -0800 (PST) X-Google-Smtp-Source: ACJfBoszqCk791VhLav5gef/U501SjkTNhrh52R6dco+awBAaGwUeJdgpm79keqPtmsEU1YJG7UT X-Received: by 10.36.118.195 with SMTP id z186mr60164335itb.106.1514885474994; Tue, 02 Jan 2018 01:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514885474; cv=none; d=google.com; s=arc-20160816; b=xeK6RW7XWSO5sq7Kqm8qbbsApbqDe5P+Wr+xly6frfaoC1KxBxq4Ha7rlAAJmapnb2 Kzec2Eg+S+6sNDNLOTE53Wazopv4jDYJPzh1ByZeO4to55zWWTT9I5C6DH8OwikKLCOs z7z3vgw4p7IWTYANDPqBJZrUhGuvUSHcCWwkf/+eoddu2r/zJ2K6VNicRs5jr5SYjPay qDlrfePyIUpretP9xQThRhED2wL32UOwZjuJ8S9v5pHusA1LllryYw2uM3wkEdmsT1YT P5/iejMUZdn87sv7eHIZA6sEXU6lCIoEfsqIsrVShcKUKq0zQXKEutE8J5vmHwcj5l1d Ccmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=YP84MTl3ozEZQmbEKHfe0j7xKc+/tgauCEp85Sb0dhU=; b=Y/FcJTewBrUCRp3aQw0eCiANWXRkjNSu1WIcNWIPq1oQhJEaxLelbgqSQAaTJGdpG6 2eB2c+TrU0rx7hZyzjSX+MHZGM4I2652Zibi22QR3w7LTh4mTDoLW4V80BaHc3cXeRx2 U7gsk1SBGC4BBm9U5GhsbyMYC6LVL6y75l0CDbqYcUqa2w+maUc9wgeM34AMYHy/+adv aoOXTDirXvhElWBVa3tKoIV6zdTxHf+2nQd+gBPs9LjObKsY9a4K0WWQp+xuvdn04p1T CrO24JbIiggmLJ6UKRPz1oxZbIwW2OI9FQGl3G2IoOPWA+e5/vE1QPTygkXrB/OVe/c0 ieQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X0xnTc1B; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id b12si14551325iof.175.2018.01.02.01.31.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 01:31:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X0xnTc1B; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWIsn-0002sE-Qw; Tue, 02 Jan 2018 09:29:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWIsm-0002rI-Ln for xen-devel@lists.xenproject.org; Tue, 02 Jan 2018 09:29:16 +0000 X-Inumbo-ID: 3eae6519-ef9f-11e7-b4a6-bc764e045a96 Received: from mail-pl0-x243.google.com (unknown [2607:f8b0:400e:c01::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 3eae6519-ef9f-11e7-b4a6-bc764e045a96; Tue, 02 Jan 2018 10:28:09 +0100 (CET) Received: by mail-pl0-x243.google.com with SMTP id b96so28335661pli.2 for ; Tue, 02 Jan 2018 01:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=roswu9BnNPiNA4KFv7UbKhORPI+pqOGS7up8OSzuxxQ=; b=X0xnTc1BhoTS7GaEQKdCvSBuNZPuZwApbvY9Pp6XWVtmo+sYAhYokB0Qqay9NRdb/X jsUfPwq14nnMs31LiwsYBe6lzuci+/D//2IE2qpFglpHvnth2WIuI/rv8F6AHCd1iY6H kqeV/ptF5M8DIWS+fBN8FFZdnIpGLaujvOk08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=roswu9BnNPiNA4KFv7UbKhORPI+pqOGS7up8OSzuxxQ=; b=j6qWdXoXY7mg4aZz7dsNoritQu9ETKdRRnauMOXJGhqhghsgivFt49MpSDBSuWnewF OlFENHhIbF7IrcZYm3v6lCkQkl08YhPmuocrQBlSf83+HU9vKBK96N+umw4Oc2MuKXRO fMSx7V9QXp1LnvWBCi2pGhrBThrz41g6AgtuRVGEqwFR0GXlq6NPyxbtYPJ0h5YZeBcg Plg7jeuHHb7/NkFyhxZ6xVQd3ogKjiHoRaLGvNe+rpQ6m4J+rCs03vc1qAp6kRihSYVs cCZNpwzSa8C9hHTpKCPYxFLTc0phkqkrYwMavjeaOlaVWjkPrDQT0Vz84kRz1lRw1NGl uIXA== X-Gm-Message-State: AKGB3mICSqdvYzTMeR0pLvVpstqbwNtTc4JN73AuyWZLddsOjS5XkjVA 7X9Sff+8NR8z9bUzxvEiMKl3t3Px0Jc= X-Received: by 10.159.253.5 with SMTP id p5mr19377228pls.7.1514885354502; Tue, 02 Jan 2018 01:29:14 -0800 (PST) Received: from thunder-dev-box.domain.name ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id e8sm22065207pgs.44.2018.01.02.01.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 01:29:14 -0800 (PST) From: manish.jaggi@linaro.org To: xen-devel@lists.xenproject.org, julien.grall@linaro.org, sameer.goel@linaro.org, andre.przywara@linaro.org Date: Tue, 2 Jan 2018 14:58:09 +0530 Message-Id: <20180102092809.1841-12-manish.jaggi@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180102092809.1841-1-manish.jaggi@linaro.org> References: <20180102092809.1841-1-manish.jaggi@linaro.org> Cc: Manish Jaggi , manish.jaggi@cavium.com Subject: [Xen-devel] [RFC 11/11] Add to_pci_dev macro X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Manish Jaggi This patch adds to_pci_dev macro Signed-off-by: Manish Jaggi --- xen/include/xen/pci.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index 43f21251a5..4c7ff4dd10 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -92,8 +92,11 @@ struct pci_dev { #define PT_FAULT_THRESHOLD 10 } fault; u64 vf_rlen[6]; + struct device dev; }; +#define to_pci_dev(p) container_of(p, struct pci_dev, dev) +#define pci_domain_nr(dev) dev->seg #define for_each_pdev(domain, pdev) \ list_for_each_entry(pdev, &(domain->arch.pdev_list), domain_list)