From patchwork Wed Apr 24 19:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915545 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 99BA713B5 for ; Wed, 24 Apr 2019 19:17:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87D3028BBF for ; Wed, 24 Apr 2019 19:17:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8581228BC9; Wed, 24 Apr 2019 19:17:51 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B65028BBF for ; Wed, 24 Apr 2019 19:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kv9ZrTunbrmo+60p17nNNDIdhH0zRCClmLUjvWCBZE0=; b=EUPTr1MMctCNsP Acqkf8UiIYUfq5hO3CnoqouNmjVnYDwxBE3xM4El5Ribpv/JO9dX2J/78DS/efdF+cFZeHaH5f/57 ctJwovRR04ellUcQml6RLJefSXyGPZMlRHUGRsBSelfDlY16zuv55TqcPjLqwmguSv9RC+laHgs51 DTiwnCwjI5qiLga6rzPZybql9kS6+SbnMW5njiFhhYp8VISQrUI6SNP4HxyKYXVYfB7HXorgiWkVL a4bBPTUpysBH4COmexwOLZbI0Alik4JkpiR0p+6gR64WT0QFalBoM82pddFH59LtDG3exjWEirQZL xu8XZQC6ec+2cRr8wQBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOp-0002X3-B6; Wed, 24 Apr 2019 19:17:43 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOm-0002Wa-Gl for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:41 +0000 Received: by mail-wm1-x342.google.com with SMTP id v14so6656925wmf.2 for ; Wed, 24 Apr 2019 12:17:40 -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=vWfV/uLxHlKTCY8jgaOm/hsQsubaADZJKJWfjxs7Npo=; b=q/vVbZY/oSONQZN13xcosLByqm2O1DfMuokvB/Zs2CWi9b5hGXmvyq5jC9E3clmH+l mIkrlnMdfjyZvxDJ7sKt77zegqGhpIuSqQ+loZavowwQos0CAq4G8VuC2WsyZSU4w9eS FEpVZEGh+2MtbxAPoEBXG807GvXT+LbvdPixqZwaMbJnTUMyKK9cG9RgV7pugAkrGx0+ VlDqc1JKTGsHMFI/rNNYUesCgEfddgmbZ68Cmkgj3BJX0xcTRbEbCbMwco6Yc1n7sbDy tm3SLEuQ1Aojh+7gfxXY3GPDcxlsHmodwHLzy1agZwERBblJjhvLLUlBgvN1AxNgjjzB +NYQ== 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=vWfV/uLxHlKTCY8jgaOm/hsQsubaADZJKJWfjxs7Npo=; b=Igg8M1uKQ7ROeSMO4VoxTgDhrkF20bqQN4e5nZARkZce+RhSF4f2L7wvQYZ5vUiuNA SJP1eq4pMdHm4sn+U2YvhlAP/u+/fpKPrDiZO8VgXCXNhA303YPcerkAhJzxwS4eKdDM 6O/xlyJHQ4gMMGn7LguTvKnsT7gwTH58L3yIRJD9fFh6eufloqAWkLAr6FU1VTO3DZps 2A6JtbvAn5/mSIg2dcHtqwEAVshI9z3I9YOOhLTRkfQNj1Quu5r+W7EO2WXfrnhN0wk6 uHHK+3Hn5qmybedwg/3eqDHNk4OioPGh/n7i/mcCv+PiWHijLola+EcxhMSKpSG0PqyQ WWLw== X-Gm-Message-State: APjAAAVbOpXPXQNUIQNwONn26PgfhvIoBLL98PSHd5USv3SL5M4cqLo+ X0rty9nBmKr1GaT5aHRfjFU= X-Google-Smtp-Source: APXvYqy1cGZoaC1duyy6JSmEOesKryNZXcbz5ec5DLtsSEFpsU7HttVUGLgD8gDdtV6ofxfO1zXzUA== X-Received: by 2002:a05:600c:22d1:: with SMTP id 17mr449859wmg.62.1556133458836; Wed, 24 Apr 2019 12:17:38 -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 s18sm19261192wmc.41.2019.04.24.12.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:37 -0700 (PDT) Subject: [PATCH v2 1/9] PCI: add 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: Date: Wed, 24 Apr 2019 21:11:58 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121740_586163_300F356F X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In several places in the kernel we find PCI_DEVID used like this: PCI_DEVID(dev->bus->number, dev->devfn) Therefore create a helper for it. Signed-off-by: Heiner Kallweit --- include/linux/pci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 2c056a7a7..28d0313a3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -598,6 +598,11 @@ struct pci_bus { #define to_pci_bus(n) container_of(n, struct pci_bus, dev) +static inline u16 pci_dev_id(struct pci_dev *dev) +{ + return PCI_DEVID(dev->bus->number, dev->devfn); +} + /* * Returns true if the PCI bus is root (behind host-PCI bridge), * false otherwise From patchwork Wed Apr 24 19:12:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915547 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 7E994161F for ; Wed, 24 Apr 2019 19:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AB1428BB6 for ; Wed, 24 Apr 2019 19:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68E2028BCE; Wed, 24 Apr 2019 19:18:01 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 012B228BCA for ; Wed, 24 Apr 2019 19:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/maGFLJn2f0XBTZMlLlZkoUH3cRrNeK0VpUKXTPGoF0=; b=HfoVcr1LTa/77u /W4G20yDpsdU4eqIHEew4VF9e2qp1GA13oLSArdXlS10mZTO506ykq9U9Y5x27z5Xuf8wkXZH82XQ cYH4sO1czipmgsy/yOBEZPtynb1rR3z5hqJfxBs5Knp9nYrFbwsNXa8OST8Gty8o++M7corxyb/cl fZLN/N43CNeUsdj+da0vTi+J5B+SceZ8dh9fAXLlPsKaRJWMq90UgTB+XunjX1COV9Pic0iXolm4n IuG1eiZw6t6GsfTzmh+TlTrUoIVK9Rmj90xACmOzhMuyU8GoQSp+D7iB8dBLfSg3g9fVxDdT1PcZK UqIgdveWh88scLWo2jmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNP2-0002mp-Q0; Wed, 24 Apr 2019 19:17:56 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOp-0002Wr-2N for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:44 +0000 Received: by mail-wm1-x343.google.com with SMTP id n25so6646658wmk.4 for ; Wed, 24 Apr 2019 12:17:42 -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=kB/xsYXQ3pDchMWCMlizuJaQAcde2gxIfDs80kGqcvg=; b=CTBInYBeuOjwDz9xKf2KWhzfLNI5mxAnUPPI4BWhAfkSOE+IcGDVUG/LTdlVKn0Ey3 kXb11SNQiqB+f2tzvApgE3K75ekW4vp4F4rKo2tfq2976kcwUhHVdM3czRnkLPBeL6j5 fdW4sKALm8HMDXeA4HSw9r/5mjk7UzIUoGIP/nv52R1glLBQr7mNguwP52EfgA+EyV2y UwEmJLPtOAif4lWOA8h/nDGbj6w+XyJdLKMvrB4c3zYVVXyhWbkJC4hJRXUZS/KfsJKR V6GztvWZ9hBzwOPVfQYlkGM8eQYmznplt3VVqTmyEvx37Zhusc47WL3zc9FIPbwplUOL lGcw== 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=kB/xsYXQ3pDchMWCMlizuJaQAcde2gxIfDs80kGqcvg=; b=mIMXzusxVGO0XTv7GzYzEwhZBXf9ko046XgO7hNfUtkt7tD6ZLRzf8uarVZGML/upd C3i6mILZQ7OzFO7qTuqQoZm0i9zRBB+hR00qVXVcUiP5oa78k2VbjrEnY5XjCJ2+RLYa APODeM8K2tT9eOnDNmv2neR8LBFBItsBaZJ/137YqfGvBUTxFQh8G0V+GuT0uj5bpFtT ZLpuHBw5dhQMILL0QViaEVyH1/irOefqfuGlmMPMtFwQY5MGzZj1thwrHtacSMNX1Mt2 yGI/OFfjMPIfeGTYubecOwawOWsq2S3yCC0E2VZwr5PyfVwDG24i8xTQ4bflTQdIMqJZ /lvA== X-Gm-Message-State: APjAAAWguRBx6Mlvvq+twRgiTWGYxsIGeST2DYTl+amG++8gOiIpMIs5 MYkrmT35YbrGLmT36RRnueQ= X-Google-Smtp-Source: APXvYqwLnC7/zIBsNJ0PEohfeeMVDSaWpOxoU/IBtJ5vk+4XlNCYrRJFKHauDYKLq545t4gZsrwWgA== X-Received: by 2002:a1c:2087:: with SMTP id g129mr517222wmg.114.1556133461454; Wed, 24 Apr 2019 12:17:41 -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 x192sm30686484wmf.48.2019.04.24.12.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:40 -0700 (PDT) Subject: [PATCH v2 2/9] PCI: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: <9cc03738-f664-3896-d8eb-48146772a655@gmail.com> Date: Wed, 24 Apr 2019 21:12:45 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121743_110921_45703AD8 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/pci/msi.c | 6 +++--- drivers/pci/search.c | 10 +++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 73986825d..e039b740f 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -1338,7 +1338,7 @@ irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev, struct msi_desc *desc) { return (irq_hw_number_t)desc->msi_attrib.entry_nr | - PCI_DEVID(dev->bus->number, dev->devfn) << 11 | + pci_dev_id(dev) << 11 | (pci_domain_nr(dev->bus) & 0xFFFFFFFF) << 27; } @@ -1508,7 +1508,7 @@ static int get_msi_id_cb(struct pci_dev *pdev, u16 alias, void *data) u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev) { struct device_node *of_node; - u32 rid = PCI_DEVID(pdev->bus->number, pdev->devfn); + u32 rid = pci_dev_id(pdev); pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid); @@ -1531,7 +1531,7 @@ u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev) struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev) { struct irq_domain *dom; - u32 rid = PCI_DEVID(pdev->bus->number, pdev->devfn); + u32 rid = pci_dev_id(pdev); pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid); dom = of_msi_map_get_device_domain(&pdev->dev, rid); diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 2b5f72086..5c7922612 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -33,7 +33,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, struct pci_bus *bus; int ret; - ret = fn(pdev, PCI_DEVID(pdev->bus->number, pdev->devfn), data); + ret = fn(pdev, pci_dev_id(pdev), data); if (ret) return ret; @@ -88,9 +88,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, return ret; continue; case PCI_EXP_TYPE_PCIE_BRIDGE: - ret = fn(tmp, - PCI_DEVID(tmp->bus->number, - tmp->devfn), data); + ret = fn(tmp, pci_dev_id(tmp), data); if (ret) return ret; continue; @@ -101,9 +99,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, PCI_DEVID(tmp->subordinate->number, PCI_DEVFN(0, 0)), data); else - ret = fn(tmp, - PCI_DEVID(tmp->bus->number, - tmp->devfn), data); + ret = fn(tmp, pci_dev_id(tmp), data); if (ret) return ret; } From patchwork Wed Apr 24 19:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915549 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 C7F13161F for ; Wed, 24 Apr 2019 19:18:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B41CB28B86 for ; Wed, 24 Apr 2019 19:18:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A820C28BCD; Wed, 24 Apr 2019 19:18:06 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5EF9728BBF for ; Wed, 24 Apr 2019 19:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tHOhhzNZuoxrVB6H04WSmTz29avZphyPRGX5+CXn74c=; b=thuuv6zspjrG9U EKC8QmZiGgjJkqK90MP03/QU4rZpJNMCvDB/EaXD41/3Ngy9ev1f+XeODKcpNvW+SUbWG7wp7YMZ1 vmwKFPjt4ZbqpJlBIBF8fHzum5l4/1hufXBQP+ov6KpdkXkai9kz21v1AUaBepc1fGGd7aPSMDok2 b14vPUiyCiSjaT/Fw8Qr8tBmpTVjl9Nvv0554tjTqbCh6OkL/YY+rB8s91jqTspRmqUp5zIvDNdJ5 i2k2BzSLlsNmJGny3XpXzOfzIcvE+KzWaRTkC49EZKZbwxqgUIgSvmdjEkwFD3muE1FqupZ9bgy2z mEOkXplLsa7HwupKDCJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNPA-0002vu-JE; Wed, 24 Apr 2019 19:18:04 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOr-0002YQ-HJ for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:48 +0000 Received: by mail-wr1-x441.google.com with SMTP id t17so26642027wrw.13 for ; Wed, 24 Apr 2019 12:17:45 -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=+k7fklQVC1wXNkIsXxuBFFgxierE2Y58VYjajnqTX8M=; b=KK4njm5c66wApJlm8WGtcK3eINA7bZzqf9jpF/xDcoCSdcuGWR7ygTnW7CxGOT7Zpb ClJa1zpkc0LnLQ3Y9FSdXrMwgQvpBYbm2h61pKGsBRYXBFkHEnXr7h2wDgkaAsAj6P04 n+Zhe79BzllwSlP7qQcQ1oNHfpi5n4yGvzSir6Qil6I+8IfT0AGlMW1C3bfb7hbIOrnv /TQKg5FQRX19gB+eGsG3WBIFJCSsQmuhe604FqNiT/pZUC4DClEWV5U3gwAbTgI70ma+ +jCLa9iSGj52KBjpTWMg0o/2CwQGRZzVKsI7N71kUDVC8rL8yE29inQ1qfO+L+vf3GA3 Zx2g== 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=+k7fklQVC1wXNkIsXxuBFFgxierE2Y58VYjajnqTX8M=; b=R+eVlys9YfqdMa48u/6/Kdgi3hJwjQY6ri0iJNCmvUb18+K+VTMvyPnxxBM0QmYjf8 ixa/I6/qwdSm0ubbBh+s2PziKkIrZHbZrFN+L7aEDDaa0O130qvF7rIC+WirAzRf3Br2 b0NyhQU8c5taphPlx7Mk1WvEMjhTTGNgJteAby+i6rSJB++qGWe9/YpeoV+K30N3AJXs ZOyuf2lNj19SuDjEOPyl02SaR7FU+W48aOVMAX8a41x/s+N5doEr1tM36IZ4J9Cu63r0 alPC0xgCRJeRWA9wTOBRIS8wQ4PWGmqTZrZkCUVKrEsagpC15LfRmjQkq7UbXKH6qfh0 97cA== X-Gm-Message-State: APjAAAUL8naoTfwDTBJ9Uu+dJXuHp+S1D8ZbOb8eTb8vSaN0xPqZg4cE Z6z+EmaSzIIdjSejerP8AoE= X-Google-Smtp-Source: APXvYqwDmKBVeUMPZVGyJTnitTfK6cM0z/PsKemtuUUK1m2YTTQaoqWzBVErwIt/ROAiTYboFRIU3w== X-Received: by 2002:a5d:5485:: with SMTP id h5mr377002wrv.315.1556133463901; Wed, 24 Apr 2019 12:17:43 -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 u1sm2183653wrp.69.2019.04.24.12.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:43 -0700 (PDT) Subject: [PATCH v2 3/9] r8169: use new 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: Date: Wed, 24 Apr 2019 21:13:25 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121746_011883_ECF62F41 X-CRM114-Status: GOOD ( 14.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index efaea1a0a..ae476fe8d 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -7020,8 +7020,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp) new_bus->priv = tp; new_bus->parent = &pdev->dev; new_bus->irq[0] = PHY_IGNORE_INTERRUPT; - snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", - PCI_DEVID(pdev->bus->number, pdev->devfn)); + snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", pci_dev_id(pdev)); new_bus->read = r8169_mdio_read_reg; new_bus->write = r8169_mdio_write_reg; From patchwork Wed Apr 24 19:14:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915557 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 4BE2913B5 for ; Wed, 24 Apr 2019 19:18:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A66F28AB6 for ; Wed, 24 Apr 2019 19:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D83A28BB3; Wed, 24 Apr 2019 19:18:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDC9128BAB for ; Wed, 24 Apr 2019 19:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kNCyqAAxqWIVVepqFSBRGrkmWiRzHq2RTtJE1IK+WFA=; b=hiE/h1cX8uMTu5 /BP0a1JuGQsutGr1++01tuRKkfUkmOTweyEcHtuMQwmevPmAoxmTDOBnIUGYH0Rffob0nXfv3bQT5 Rurhu3AvUtP5Ue3hdCwYQPU0gpbWTMtU0MmKcDez3vFBfHYEw3BusyXjVAkTH+1lSkvR86fzhx40c LkO/FhlV0GLJzeNDiiZIQlzBPTQF4pPhc6iUDfd9cBsBIWvsmtRAuo/cdTEKDCVZzCkXJS7UERQcG icNxsGruokMP+gSBQUMtzdMRaBJeFTzW85Ax7InL53kV7zmOtqoOnil19y+ob/uuJFiZyKCL0D00p Mi7CtRAP0nXe0wakszxg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNPK-0003B5-6J; Wed, 24 Apr 2019 19:18:14 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOu-0002c7-1f for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:50 +0000 Received: by mail-wr1-x444.google.com with SMTP id c6so20999593wrm.1 for ; Wed, 24 Apr 2019 12:17:47 -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=hab7qAz6lzS7ZRowBkQ/f/HEdXNfdhNCdKWF0/BVKmE=; b=IBX0KuQhIHPofugi8VbvuAnaDQlqeZ9svo7oPOlRq9Nl+c4hfx7GC4G6FUzkUJubse wiLJj/sOBCAdP1NhfNYrPK8BsSVeCk2cAA9eP+HTjzeXBPDI3xwU9YjRDKxu7BUkh9Qy ARW/rPtI4IpoC3x2CibtLLT839KW5Gqd98nS+2DFcQq+T+/e7v1mCfxpxSvQXhLRtDMs OI5Y+gnOsn5tFiln6JJbcNGlizY5/JYmaoqck6PjX5tjV488YO+0nhW8BLltqBNP29iS aIYrY8Al7ib3uqnETxszQ99kc8ZoQ/z7edNx0J2Z7OwrxHfOrSpfu23Pmg27nR0v1NZi ReGg== 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=hab7qAz6lzS7ZRowBkQ/f/HEdXNfdhNCdKWF0/BVKmE=; b=d4mQ4eE1odqbNf2q3j7cXnBNnpJ0h+CNHwMesgJjKy7OIL+Xch5g9yb7y37a1o7rQX M2zOulPQ2eYD4Q6tViJnBVrBI521M4eTFYPJuFILsyo7aCIcKxD9lMzvrRNiOUSxD/yJ cYfc/gSbpUMH6MSOv5Xb+5PDbxHJ3BIs4C6guYC+Nho19Hpsz+9i8r0fryTv6FZ8JyhZ EVb3/IEzAZyrqFY5gG+VSBV5BIarPtbFIRUDLQmdi4GEHUTU/Y83ouG1EG3KgAXHBECy rqfJZnO36MLvxiN7Fn2Eu5mk9Z+F6CrqXMw26A22fpWmuCS9EOuXBJgHDSNk/LCa+wh1 bUvQ== X-Gm-Message-State: APjAAAVxFpz7HF2uN6TOpHhXU0zRmoryiLVSIqm9EmHC2xLO+N81f+0+ 2ejakC6SY1OG1AbbBbTuBJw= X-Google-Smtp-Source: APXvYqy3cqzUuKRDBnCN6u4ytA6IsqF8dbo/CC+cpZ/NjBgj06qGIEA9zqzusRK5xh+DIv6B8gl90A== X-Received: by 2002:a5d:4b4e:: with SMTP id w14mr18245461wrs.15.1556133466411; Wed, 24 Apr 2019 12:17:46 -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 p6sm18060129wrs.6.2019.04.24.12.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:45 -0700 (PDT) Subject: [PATCH v2 4/9] powerpc/powernv/npu: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: <8ed5b4ee-3226-6786-eb96-886826e180cd@gmail.com> Date: Wed, 24 Apr 2019 21:14:25 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121748_276879_8C7DA195 X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/npu-dma.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c index dc23d9d2a..495550432 100644 --- a/arch/powerpc/platforms/powernv/npu-dma.c +++ b/arch/powerpc/platforms/powernv/npu-dma.c @@ -1213,9 +1213,8 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid, * Currently we only support radix and non-zero LPCR only makes sense * for hash tables so skiboot expects the LPCR parameter to be a zero. */ - ret = opal_npu_map_lpar(nphb->opal_id, - PCI_DEVID(gpdev->bus->number, gpdev->devfn), lparid, - 0 /* LPCR bits */); + ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), lparid, + 0 /* LPCR bits */); if (ret) { dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret); return ret; @@ -1224,7 +1223,7 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid, dev_dbg(&gpdev->dev, "init context opalid=%llu msr=%lx\n", nphb->opal_id, msr); ret = opal_npu_init_context(nphb->opal_id, 0/*__unused*/, msr, - PCI_DEVID(gpdev->bus->number, gpdev->devfn)); + pci_dev_id(gpdev)); if (ret < 0) dev_err(&gpdev->dev, "Failed to init context: %d\n", ret); else @@ -1258,7 +1257,7 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev) dev_dbg(&gpdev->dev, "destroy context opalid=%llu\n", nphb->opal_id); ret = opal_npu_destroy_context(nphb->opal_id, 0/*__unused*/, - PCI_DEVID(gpdev->bus->number, gpdev->devfn)); + pci_dev_id(gpdev)); if (ret < 0) { dev_err(&gpdev->dev, "Failed to destroy context: %d\n", ret); return ret; @@ -1266,9 +1265,8 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev) /* Set LPID to 0 anyway, just to be safe */ dev_dbg(&gpdev->dev, "Map LPAR opalid=%llu lparid=0\n", nphb->opal_id); - ret = opal_npu_map_lpar(nphb->opal_id, - PCI_DEVID(gpdev->bus->number, gpdev->devfn), 0 /*LPID*/, - 0 /* LPCR bits */); + ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), 0 /*LPID*/, + 0 /* LPCR bits */); if (ret) dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret); From patchwork Wed Apr 24 19:14:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915565 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 52F5513B5 for ; Wed, 24 Apr 2019 19:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4281A28BAC for ; Wed, 24 Apr 2019 19:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 366C028BC2; Wed, 24 Apr 2019 19:18:33 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E33E728ABF for ; Wed, 24 Apr 2019 19:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2qUZiLguP+4/3fFOgJQ6TKPZUyiAIcd+0iVYIu3ZGxc=; b=LD5iFXYRlvCkNy yE7zfG6vtkMzXM2Q6a0kBnXn55vEGgmLX69CBnWwQdWOHYJm9EHDX4Ye6svjUkuSjymriLEPuoMIq YB8p6L4CqrXf4c2/C01mc0eaKxPLJLMKN1zca8qCu/EK+KBjj31lRpoJCd20Yf/N7bho9qo1t3wkS sES0+TFCttFoxzfHu8KqkcQ5KGusOoFsG6JLlJFbNOAi6wWyiT5xgcW5XlEN6imNllEgePSTBOlEi qD4robz/arypy51wDISM7ymdv0HRlxJ5yBP3zhSZYDixjda5ftYSpvWC1jK3Ib2p+0jpZos62p/nD VQHimCr2qLPcj1EYcEgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNPW-0003Pr-EO; Wed, 24 Apr 2019 19:18:26 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOw-0002g1-Ii for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:52 +0000 Received: by mail-wr1-x443.google.com with SMTP id a12so3432715wrq.10 for ; Wed, 24 Apr 2019 12:17:50 -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=JGOU3ia6g6f+mcCeqoj5rUs2fETF3ERMMj8iqSjiOI4=; b=N+WDYEss0BjujrTkoVQFmlZMauTQnxRdnQZfZb7Pj5loUGC4okCuuv16tnp3aMqup9 iAjLrSNm+TMJmHj3YYK9T/bwzZxTQKmGcK/m44oWL5evBfcPwpv2eoAi9aqBLRf40l7b ZsYLe15al+e+C0axyxR8ts7wuFEGb5+V5SLcItizyuxglNbmNpn9ZJIUpYxtl2BnxfHM cMMEPrEFkthMa9Qfs8gl42cjef5Z4uJaPHZZ7LyHX/GXlTmyzP2/mOIFXaU55f72KVC6 ZxazwPCP9QGXRTy/D2w8I7pZ0CJEwXBPsTEPewxOtZegukdlOLsrv1x21Y+4zxQftilz SuZQ== 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=JGOU3ia6g6f+mcCeqoj5rUs2fETF3ERMMj8iqSjiOI4=; b=aEJLpQmEqzfeN2kBGjmcIPMyaigpPXa5/pEkay4sSsRfK5nTxqOlWXtaLd6sMNd3uP eug8AZHks+xcDl80OJMin4tHwQOiORNE/2CqCs3LcEh7htWbp5TAAcBSThDWV4i1aa4M VbxoeFyLoaQe8WQZWzHp4reXyAj3XlpL5MK6t5fwBLRdItZ74S8jjKVOTupBHUeLWgY/ jgYmpH60L2IX1JZMwviSRH3tqegNUwLVkjKVgqPRmFjltnJZqeW6Byr/od9XjJaYSUeh YweQgph9OCodUHRPgw0yoctTYazlDKmIaHHeUOrCylONlUb9tMKcUM429WkStnPX373G +vcw== X-Gm-Message-State: APjAAAXHVQ36xAYX74lbYdE3Dpjm0rbg8IXCjbB7EREjD+XwWvON7RYu wQlO9BVX1Bh4ykprztSUYzc= X-Google-Smtp-Source: APXvYqyys0p4vzH3+QBE8b2LeEy6eALBMG3KHgepXOv8RrEgFJw4q6sOt683Zhup+UYIuSsIl60E9Q== X-Received: by 2002:a5d:52ce:: with SMTP id r14mr23877569wrv.224.1556133468924; Wed, 24 Apr 2019 12:17:48 -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 s7sm3419954wrn.84.2019.04.24.12.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:48 -0700 (PDT) Subject: [PATCH v2 5/9] drm/amdkfd: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: <50613002-d5a2-2522-b183-4ab156686fce@gmail.com> Date: Wed, 24 Apr 2019 21:14:55 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121750_877323_F248746B X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit Acked-by: Christian König --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 2cb09e088..769dbc7be 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1272,8 +1272,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu) dev->node_props.vendor_id = gpu->pdev->vendor; dev->node_props.device_id = gpu->pdev->device; - dev->node_props.location_id = PCI_DEVID(gpu->pdev->bus->number, - gpu->pdev->devfn); + dev->node_props.location_id = pci_dev_id(gpu->pdev); dev->node_props.max_engine_clk_fcompute = amdgpu_amdkfd_get_max_engine_clock_in_mhz(dev->gpu->kgd); dev->node_props.max_engine_clk_ccompute = From patchwork Wed Apr 24 19:15:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915569 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 547A513B5 for ; Wed, 24 Apr 2019 19:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 434F228BB3 for ; Wed, 24 Apr 2019 19:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3566528BBB; Wed, 24 Apr 2019 19:18:41 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D13E528B81 for ; Wed, 24 Apr 2019 19:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YmkHtYl2Wn3O6ujBE/GTzfjaQl88zo5HyLX1JvTkCvg=; b=HD1i1eNsvVYJTd hnQkGMHbyXNJ+M8f6HF4a5UhnFwFxZAsuQ88C93cWA3uJRR4YB8fYrAGmZ6k6z6kyZskKGMhiT9hl D4pGWW4gea1J6VMsrnSkf9mIIj9cAfl8bw8wAWLf8dlY0pkvLTNg2t7mGs29C/DiZyZkPFuTuf9jZ 0x54rUcK/Abm+zwrD4X/kX4qsnbFnk9xCS7vGmxAlLVnVHWKusN3n5Toy6aHMDT76UB5EnzMb1JU0 ssGaR4kpVYY2wmM7xmi8z91WkHXW1lHvnVfKoRNgTYjj7EbbGpvJDz+HgxhQt2HVqAbS4qN0NqSgg MYuwzIY9pa1OzujS/CQw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNPf-0003eL-Ia; Wed, 24 Apr 2019 19:18:35 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNOy-0002ji-QJ for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:54 +0000 Received: by mail-wm1-x341.google.com with SMTP id y197so6668344wmd.0 for ; Wed, 24 Apr 2019 12:17:52 -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=IeRjLmIo3+zL+ngn2z6PfEn9LxaA8z9ME0E/GMbJl4A=; b=TUzhCOH2F7RvxialpvgaUFfNbsBpgDv13m50OH+yCHXNzbKgkQ3+3J9fmVotTjHhZ+ nT72Tzc880/U6F/39r2rOLBXumQ/j5RU5NezTirLrIrK8HKif6onpzxPkeL9+3b1vQq2 1DjaR7ZH62jNLmGYqQQPFRrk8RastcZUjByEctXZYR9dDWVH50TBAdTissGRPJJFAaku yTmszbRe7C6g/MQlgrFC4qFKTUqOyA0NfxLlCq1xXJvcaq0cajMvWvopZxIRGurM8C5w Ky8/X9fshxb+9fnIfYrOG+f4N+cBIWfqByuQioMYFAZ1K6Xx48p3R+XHvkUnajpJttNi B/0A== 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=IeRjLmIo3+zL+ngn2z6PfEn9LxaA8z9ME0E/GMbJl4A=; b=hHfY9H/+BXS4n+QXksjCu86vdAwCeaJ9qBOVDfQAf6T6M61uuUMl/vd8fz6fkJxLKp A0WnOcUP/5fMkhL/w0X47AVygrNlYqJD2w4df1U9nbL0/ccpqeOGcKb0lYS+d760CzR4 RcsP5V5zfTR3BzXjJS3oRc7N75iQJKyyBwnSxH8tNu/Bh6+Z4oq76bpvA6tsE7i3B4L1 Sk7HH8lOSz/3KUbUclzJDYfHoCIQ3+Ty+MFpfes2V2zWiA8rrOOyB1KIhLqEY0jc4nJo M2Eud2UWF7UCF55LnslXX+Vek8cGb0qNtt8efmvLou2OHj4IEjT3DSLE5Ul6De3XisQz ob6A== X-Gm-Message-State: APjAAAWyMLaE+lDeVkF1O3Zsehs09tW+nUtyi8nvUvRjV2FaeUEuIIWm F9nUOPvhZlBKZcTFe5SIcxs= X-Google-Smtp-Source: APXvYqwLwnDZWORI7BhpqSdPQhydSnH4TJiDh5p2OFwPcJ1S0/zRXEp6j1rg2GAjg1ue7Rb470bFqw== X-Received: by 2002:a1c:4c1a:: with SMTP id z26mr474306wmf.73.1556133471446; Wed, 24 Apr 2019 12:17:51 -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 a11sm16605685wrx.5.2019.04.24.12.17.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:50 -0700 (PDT) Subject: [PATCH v2 6/9] iommu/amd: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: Date: Wed, 24 Apr 2019 21:15:25 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121752_974707_99AA8268 X-CRM114-Status: GOOD ( 14.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index f467cc4b4..5cb201422 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -165,7 +165,7 @@ static inline u16 get_pci_device_id(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); - return PCI_DEVID(pdev->bus->number, pdev->devfn); + return pci_dev_id(pdev); } static inline int get_acpihid_device_id(struct device *dev, From patchwork Wed Apr 24 19:16:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915573 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 935FE13B5 for ; Wed, 24 Apr 2019 19:19:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CE1428AB6 for ; Wed, 24 Apr 2019 19:19:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7020D28BBE; Wed, 24 Apr 2019 19:19:23 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C6D428AB6 for ; Wed, 24 Apr 2019 19:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sTA1wiOiMRcYTTtouxRy261wU0efAaleFBt5HhLtYw4=; b=rEqcQQ4RfBfXzv AgHjlAZxKzje/vOs1XaA4Rls+wCqKjUi9AJbSABzot+OrObUgIsZShojOIkC+dEedPDeIerKaktAc f//TSIpi14C3mha145L+Pu+b0TO4N0+PCKIiwMGKP2tRyF5OI+I/w7agCFc3t4bDBp0mErAO5Ou0O R2Tt1wNyh5AxTmCDFNLnKFwM3JQB/UaM9EAeE83Kq5RDqTmoLd12VviHqp//uDl1K2FENnUKY8vCf YRAKiRiAsZsCbm1uUBlQjDz9gAvQbj7+2HQJwsefsP/WBFFNA883bfGm9p5a7rkuzjNKveF6frEcz g3/S+KTt2ZYO0ShJ7LXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNQL-00042Z-22; Wed, 24 Apr 2019 19:19:17 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNP1-0002lj-Ii for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:17:56 +0000 Received: by mail-wm1-x344.google.com with SMTP id z24so6672699wmi.5 for ; Wed, 24 Apr 2019 12:17:55 -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=Lhf3zh/6koaaVjHsmVGV2OqS+ZTHKL46AJ1hCT+4QJ6mOLl9Ui5HlRVouEb6RYZto5 w+iuh7VXsPs9jB2s4XQk86xezluBrSXTNLGrWkKdvkxPbUTvalm30BV+Lh5qyiOGKdnM B+vBGsqhx16KvA1q+NU5uqrHq0B60LLQi/TCbkFRmOYfLsB6xuXnl4CJ4bIK9IYBpZk1 diFyIuvAH3dwPsNCRfBk3YQZWjnh5pi5Ns5jSz9ndTSCinGuYdyBXTHan4Jp20ON/oyS a2CizOGKyDjTM1b9LEBdB5kiqsFIKR+BkL+OXIa6TqfVHjHZNC5g8XtQlNkUqbCzVosY yiOw== X-Gm-Message-State: APjAAAU3dWv/kXLPZ0HiF+Fp7dljW3WVcFpqROqUJTdoLA8NSXr2FsLz RbBfn20/yNENQACZu+3xaFo= X-Google-Smtp-Source: APXvYqwx9IkvpF+W2lsA3mJH7M+n+CqCAXpBhPx/pthS51v7A1zJHA2H9Ks26cyCm8y+AFp3wsoEFA== 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121755_613496_456861F8 X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Joerg Roedel --- 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; } From patchwork Wed Apr 24 19:16:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915575 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 D61531390 for ; Wed, 24 Apr 2019 19:19:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C450528A97 for ; Wed, 24 Apr 2019 19:19:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B866728AB3; Wed, 24 Apr 2019 19:19:29 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7311D28A97 for ; Wed, 24 Apr 2019 19:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cu+kYnKdWGALLnNj4g66UMdNUYF7q3hspgV6Bwp3p14=; b=CnJd1SaL4DN3hc BAFR+RCGX0X4cLPo+gTkghYHu+aexj/c9VGyq4yL1OtrXi12v+0DxY94TS+cn89r+VDlM6lI8AS71 WVMRxnoJbMvrZxcr0pkeVD4vurwqvmn1A0kTXXuqCWHoc4CKwqUTU+IQ1K96juGXLK+pDHX1W51NM HtiuiJ7ZtJNSxAhZT0NIHWp1ZvOPCrFDVs2WkChTFJSQ7lSjUS4es6bAyFpZe8e8z3/f1ywmjdtol NmvLU3pU+m/roxZUcqaexCvJIQ1AKch82OOU9GVPGcnmnqiSJzUL8ZkZKoNvI+/R9vbQV64TYIf4q ejpIrfdGr8EEYGzlswuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNQT-0004Fq-4e; Wed, 24 Apr 2019 19:19:25 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNP3-0002nD-Nk for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:18:00 +0000 Received: by mail-wm1-x343.google.com with SMTP id j13so6094256wmh.2 for ; Wed, 24 Apr 2019 12:17:57 -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=SAbbSQG37YeApBp0oyHaMCbtBHNMxP+2zNJpk+CsD/M=; b=AIXRJwuB+H8CUQQMeS5qlpm0mA9MRtCpnvd55esAPnP4ZWf8RvpdvE922lJmqnVIpB 3WTSTa1p1xLB/UPdSXHtSdMm3TwK0Ijnw5bZfpyK0oWvEVW3C09vKa1Q2aYpH2hWevRC LzFsybDvUKqNfYk+TG/LaBrmNyzjfxLPOoWGgrjG+moMF94/PiKjNMdt7AGAj8dA59K4 1/Eg3DgVYvKL5GLVCx68IVgAiK56Pb2bmSAxMnuMtfO32YoCnamKsq6gqu71j44UcOgv 4GZRg98MJRc10wCTTm84P0cCLZbrQhwuPU/OgImeBXnr5lQkDyGgHFjzV90i9GpJdHs7 kLQw== 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=SAbbSQG37YeApBp0oyHaMCbtBHNMxP+2zNJpk+CsD/M=; b=YYYn4nDlQIQAhR2FetPy0xjEXmBM3kZrzwtrteMlVTHyc2lFUPNJPaeHrndC7zTuRP 3DBAhMVvDU0bfCVuE7/FN2ZbgpAr97unl94tshN2X4X6QBoYsUFw6T6UrWf+8jSeWCiS jj3jhdtGgHMCyy2rR4m/ZCRJ9uu3PyyRdZKmbPMka7kgAIs8fqBugeG8MWOLLnjPzgML VkJsGzznoUdyQrUaeIIEpecSrchr3352yCz/Xcktiv+sVH2+pPIiVL62kHVb5hmsOSVK SdL7kEx6qPIgdbh8RyBgkM9OAajrGJj1bcLv3FidFgQC9IerY8Dtf0yWbX++s3hDN7ym LokA== X-Gm-Message-State: APjAAAUGoFP7e40TtXMGI8zOtFDDlE2BNGp/ZEgD8sN+vhEhNS+g1ago nja17HVDgI166MWAL05YVB0= X-Google-Smtp-Source: APXvYqz1FxREHsjxcSzzKYBRZR1hyc+jklGgIQJ7OMGK1qrzBngr1H8WAm880vG55Y8yYFtfRLfERA== X-Received: by 2002:a1c:f50a:: with SMTP id t10mr473319wmh.86.1556133476436; Wed, 24 Apr 2019 12:17:56 -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 q202sm4917605wme.9.2019.04.24.12.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:55 -0700 (PDT) Subject: [PATCH v2 8/9] stmmac: pci: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: <82febf42-5f1e-a5d1-5c38-40dcaefdf700@gmail.com> Date: Wed, 24 Apr 2019 21:16:41 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121758_036557_EF464EDD X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index cc1e887e4..0e87a9596 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -208,7 +208,7 @@ static int quark_default_data(struct pci_dev *pdev, ret = 1; } - plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn); + plat->bus_id = pci_dev_id(pdev); plat->phy_addr = ret; plat->interface = PHY_INTERFACE_MODE_RMII; From patchwork Wed Apr 24 19:17:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10915579 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 2975D1390 for ; Wed, 24 Apr 2019 19:19:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163712892C for ; Wed, 24 Apr 2019 19:19:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08D5028A97; Wed, 24 Apr 2019 19:19: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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF2842892C for ; Wed, 24 Apr 2019 19:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dvRMxqEOvHFJT74zFN1YnTNKpD2y0lCIBC2MJxkXgv4=; b=VCD+5CKTo6+2lY 9RqNwqd2VyqraPdGbZKeNt8K7QWZDASxaqO6++AQzhX+CDJhFkzzK/VV1Mf85Vv+RxluPpN2UIcVR g8Q+6Er6CDIJ2u6At7cz6UYvk5V+ddOk+MZ3A1YsNiVk76HR7woEifJb7yS9wYW1C4ju4KQgoRZPH GhU4Gc/BASu6Za4e0YuYZS9RFCfomRAvVyL15XJY/AkRK5TxursoZpq6jOeUHPHfcyz5BmpFAKURw qLRKHaf199X4rcmV2tP/DFiSI3fF1DZt6ze6xWObjt8zKQNmrsjB62S0uqRNseu9k7racQjBgmVSR CrQS1L5kDXoLg53PqJOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNQd-0004UN-O8; Wed, 24 Apr 2019 19:19:35 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJNP6-0002qC-61 for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 19:18:03 +0000 Received: by mail-wm1-x342.google.com with SMTP id 26so213029wmj.3 for ; Wed, 24 Apr 2019 12:18:00 -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=HyUIjv1ZcTz3BJRhp2dFVjFVc8FZkCvFMerRUJk35rs=; b=mWGOnKfdu64PXdK4VkEsSESr1A3fAGLATh3SgnROHhCWvMZgDNu3SbfVQoPybvG9pK eigLrw6HkNx5eSa60OFNw6I6AzBlh0qp0v52mQi8APrNqu/ZnNdmaA+iKPOVsqt2sCoO UOUnXM4kOp9PKJ9lKXwfABww/PaNtFz+94XxKPe2LJODsi37G30Gy73vot5PxxNWqeiU hxNThydhzbWKbCUtL5M5CZw60KzQgBVKTQSh5IWajOiiGVoJwP0oDJwDu0qP8ZACVfS0 vA0rmAJ6uWd6gloEFSDqu1PVRiB4HPHDDZoCDdJeh3wY72Eu3UBBlWTKHV+DIA2o1TxV vjqA== 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=HyUIjv1ZcTz3BJRhp2dFVjFVc8FZkCvFMerRUJk35rs=; b=Z6vl+y/Y3sg1lykag6f6tmnoP9kLPKf3SFmMCRVEiY9D4bHCZFcDKccCLEbSgUYws0 g6eJHw4JNms/30MMDbYjQYouJQwV/I1TG7dlPZuG57MVESis70Vx5tWiDc85SE3Dkqx8 N4sIDVodEfKEUb6lt2bLe5sicbord1rmYtyjhEXDbgxhqXJ8f8vlKDonLrTHXgIejkpg oqEn2PYiJr1ZUqdQtqIO9g9OmeXH6zfTj2wv4JC5GqKSCdqKPTEdG4EdT8Qj5ssDrz71 8YzGi45QErmVHiRaqOgM1eneerTeNgQcv/rZmYjNSz21Re3l1qrYsTqQLv4vcRuSnlwP 1pJg== X-Gm-Message-State: APjAAAUQIDoHjdxic8Sn7aGXGq2fvOD9Q48it7sif43CzVn2fcOgZc2L 16ZzysvtVp/Lh78nw76E3H3tr3Om5ow= X-Google-Smtp-Source: APXvYqwh3CNfCKJTs9MOTu4bXqWdzGeM/Qp5h/VOnaJHwwOVsZkGf5/cSOBP+OP8er+qIAMJlFmteg== X-Received: by 2002:a1c:9c03:: with SMTP id f3mr478703wme.67.1556133478847; Wed, 24 Apr 2019 12:17:58 -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 t17sm17033907wrr.26.2019.04.24.12.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 12:17:58 -0700 (PDT) Subject: [PATCH v2 9/9] platform/chrome: chromeos_laptop: 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 References: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com> Message-ID: Date: Wed, 24 Apr 2019 21:17:19 +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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_121800_553911_D2B1735A X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:AMD IOMMU \(AMD-VI\)" , "open list:AMD KFD" , "open list:PCI SUBSYSTEM" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new helper pci_dev_id() to simplify the code. Signed-off-by: Heiner Kallweit Acked-By: Benson Leung --- drivers/platform/chrome/chromeos_laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 24326eecd..7abbb6167 100644 --- a/drivers/platform/chrome/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c @@ -125,7 +125,7 @@ static bool chromeos_laptop_match_adapter_devid(struct device *dev, u32 devid) return false; pdev = to_pci_dev(dev); - return devid == PCI_DEVID(pdev->bus->number, pdev->devfn); + return devid == pci_dev_id(pdev); } static void chromeos_laptop_check_adapter(struct i2c_adapter *adapter)