Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1455238yba; Wed, 24 Apr 2019 23:22:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQYIfhNoYLBVJKowpcMhn9oE7x6rVt0TYMLcFXNtvIwK6oI98szHVL75h8wUz2rYopLnXW X-Received: by 2002:a65:6212:: with SMTP id d18mr35337001pgv.162.1556173363625; Wed, 24 Apr 2019 23:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556173363; cv=none; d=google.com; s=arc-20160816; b=r3TiMHzos+i4TKwLRlIYv0yVvcjdKbw6oHE29A/q4kjcctGJuDduonX85etpGiVzwg eeNAV2xzSzr/Oy/iuVcY08EWvudZTZc71UotAPUT9cj2vYmEgi8X8o68l8YB5hQjj1wF xMAPfwzwwpbtpioIqQxVL62UIBBfnEyh74O32x84bf9Gs7rtQW/Trz/pbtfuO3Z4AeRW n2ULozoscA3lgXeDiy2DXbZVmt1HlHavLm7CmCHh1qSxt2XiqMW3muxEJve5J/w2eDHh z+mie3ehA9swaygROh28LqskoR2MqVl9gZXUl1H33hNC0QOLVefsuI4MhqleOML8NRo0 10lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=L7OMDqn053nsdqraX4ZA3guqlyVTDUsFXQaouF1/Gos=; b=NMXqR4t5QE/TjJzKeHizv/hP9vWe+nL800FO9YXFl10Ol45+Gu+e52zL3ytFG91mDg j8icSc86bnYmCEITaWsc73cH+1FGFCtXyxQCu5dAWS7BKEHsA0psnErCFrwMXuSpb7Nz UbLrLhKcmZKMWllCcELATj9nwZC85BzPmD6hI5eYd9DtXYkoyOUqsLKHg/fRFiWatN1+ IEz2i5hAjlUlW/V9AlqiEN6wYieE6NUKj8Qj5rvT+GUa6oDU2hNO7+crWEeu0XVGhVCo FQxvYn+XLqm++VUViKe/q8xD5+i2s9cQ9Xfgtcw0qx2ikDrQDzAfeP+D973VMiMFL59r Cbew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="f9/VNW2z"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si21809656pld.147.2019.04.24.23.22.29; Wed, 24 Apr 2019 23:22:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="f9/VNW2z"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389507AbfDXTR7 (ORCPT + 99 others); Wed, 24 Apr 2019 15:17:59 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54074 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389451AbfDXTR4 (ORCPT ); Wed, 24 Apr 2019 15:17:56 -0400 Received: by mail-wm1-f66.google.com with SMTP id 26so212779wmj.3; Wed, 24 Apr 2019 12:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=L7OMDqn053nsdqraX4ZA3guqlyVTDUsFXQaouF1/Gos=; b=f9/VNW2zxOMYFkwIrmd9gbXTTDyAPJldpW0jlqhc9ddqz/XExcnPvUBW2cuC7iHYM3 X8sWEHPyq9nl5S69NEsfykmeiFCZbevHNdIJJgmHPsizhhWl3oiNih/U1mpX9mO9RGFS KM259Aqjr8WT/9cB8GP0T95XxV9rqSCvyVkiuYo4c3RfkmvfNBiLbt/GpLG7igafuNss 0UqWwQWIKRUnf6Oj2yQ1TbESq80ZDjagj7yMKikfjntdayHK1k3hrrzsjj3j3M7dIK3l pEEm3SCuep4hIm6x/NT02bJpFetnVPIX1ICUNx0+JawhL4nuIXclauj3K/iR0qSrEfle NQMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L7OMDqn053nsdqraX4ZA3guqlyVTDUsFXQaouF1/Gos=; b=RQczgV6Nd6x42hBFixazgdrWdHK4lZwLIl8dnFY1T/U16IeojnyCNIChDoR81KS2aI WRic1PvMUJeGJZieAD/QZksqAHkBCKY8MMDxwIgg23eMy6YqOSB2UJpr5BrBak7P0ydr TYsYjutZd4/X6TKy3fY0ZyP7sJpTvsv1G8ZgzWqQyBQ0DMYx+6J/dy2Gt4EXJ0w858bG 5AcnjkD8LS2gcl0aWsVJJLOfHgLSrM17JVPN1WeIenZV7aHrJaaApRjEWhgUvWSfkpaV XTP6o4Xi0CSCVye83V7jA0lqmpmlENf36dHzHARU1H6ut72uPwzAYTGs+SxidU5cpe9V Ds9w== X-Gm-Message-State: APjAAAV/Zt3wBw7jDMdQtvqD3ICto6iWZq1HMotXzosFpnaZCzaJmrTp auNXAHR5pnhLo7u4A5miV1pCRPFezcc= X-Received: by 2002:a7b:c446:: with SMTP id l6mr489308wmi.80.1556133473878; Wed, 24 Apr 2019 12:17:53 -0700 (PDT) Received: from ?IPv6:2003:ea:8bd4:5700:c498:ee8f:ff0a:13e5? (p200300EA8BD45700C498EE8FFF0A13E5.dip0.t-ipconnect.de. [2003:ea:8bd4:5700:c498:ee8f:ff0a:13e5]) by smtp.googlemail.com with ESMTPSA id u17sm37513417wmu.36.2019.04.24.12.17.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:53 -0700 (PDT) Subject: [PATCH v2 7/9] iommu/vt-d: use helper pci_dev_id From: Heiner Kallweit To: Benjamin Herrenschmidt , Michael Ellerman , Oded Gabbay , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , Joerg Roedel , David Woodhouse , Realtek linux nic maintainers , "David S. Miller" , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Bjorn Helgaas , Benson Leung , Enric Balletbo i Serra , Stephen Rothwell , Paul Mackerras Cc: open list , "open list:AMD KFD" , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU (AMD-VI)" , "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , "open list:PCI SUBSYSTEM" References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: <0889204c-18aa-8a5f-1781-aaf32ee5beba@gmail.com> Date: Wed, 24 Apr 2019 21:16:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/intel_irq_remapping.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index d93c4bd7d..3f475a23a 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -1391,7 +1391,7 @@ static void iommu_enable_dev_iotlb(struct device_domain_info *info) /* pdev will be returned if device is not a vf */ pf_pdev = pci_physfn(pdev); - info->pfsid = PCI_DEVID(pf_pdev->bus->number, pf_pdev->devfn); + info->pfsid = pci_dev_id(pf_pdev); } #ifdef CONFIG_INTEL_IOMMU_SVM diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 634d8f059..4160aa9f3 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -424,7 +424,7 @@ static int set_msi_sid(struct irte *irte, struct pci_dev *dev) set_irte_sid(irte, SVT_VERIFY_SID_SQ, SQ_ALL_16, data.alias); else set_irte_sid(irte, SVT_VERIFY_SID_SQ, SQ_ALL_16, - PCI_DEVID(dev->bus->number, dev->devfn)); + pci_dev_id(dev)); return 0; } -- 2.21.0