From patchwork Tue Jan 29 18:13:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786793 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 8B47C1399 for ; Tue, 29 Jan 2019 18:13:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 796422D861 for ; Tue, 29 Jan 2019 18:13:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8932DADD; Tue, 29 Jan 2019 18:13: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150B72DAB0 for ; Tue, 29 Jan 2019 18:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729133AbfA2SNS (ORCPT ); Tue, 29 Jan 2019 13:13:18 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35094 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfA2SNS (ORCPT ); Tue, 29 Jan 2019 13:13:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q5jcPUycwd0PXCcz2/cgqKIdp9jkY+nLz8sObNmDVnE=; b=A2YXyPmJnYQ4DudTsEgltXxyRC pOo9yjYkwGAWrukK+PNuToovTsge/pbQ0/gYpSN6lD8EmkiqiRLB0tJjftFJGzAKuLU0FrvLbLNN9 qgSYD2KIHgQxFP1StkhxP1NXbUZcWQ2umjAEPVa+kD7nc+DzQpEoLI5drw5X1ig/DohPZyXRy07n4 uaNX5GZPKAZL26oW9RGoXhPe68vwjy0w3pq0exTcpkGIE72qyivDNohMdSviZFEfr0FX7BjJcKtWU ojyankOAjcv0gZdHdg1N8GUW8m63eV70SCJ76hcHZvS0crVXU/OZcYrH0HValClmX4lnvRKJpd6Ab IF4lrAGA==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXsq-00080R-6d; Tue, 29 Jan 2019 18:13:16 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] parisc: don't include in Date: Tue, 29 Jan 2019 19:13:03 +0100 Message-Id: <20190129181310.5557-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No need for any of the definitions here, all there real work now happens out of line. Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/dma-mapping.h | 2 -- arch/parisc/kernel/setup.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index 44a9f97194aa..f1bf5e297f1c 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h @@ -2,8 +2,6 @@ #ifndef _PARISC_DMA_MAPPING_H #define _PARISC_DMA_MAPPING_H -#include - /* ** We need to support 4 different coherent dma models with one binary: ** diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index f2cf86ac279b..15dd9e21be7e 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include From patchwork Tue Jan 29 18:13:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786807 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 A47C4139A for ; Tue, 29 Jan 2019 18:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 924172CBF2 for ; Tue, 29 Jan 2019 18:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 866D22CC2B; Tue, 29 Jan 2019 18:13:55 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E54972CC13 for ; Tue, 29 Jan 2019 18:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728214AbfA2SNW (ORCPT ); Tue, 29 Jan 2019 13:13:22 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35134 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfA2SNW (ORCPT ); Tue, 29 Jan 2019 13:13:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H8HydUcBf3fQy/JxzoOyf+88iu8OhBkRvwe5JdqfBr8=; b=r5pvgvWLZ44buCS66xYASvOa3X 51x8e1swLc04vRVxFm1nAn71/vY55BYg3u6wNMzEUrTYuNFnxMUXtNlutU04zbpZFBmfR08MUwhtU 2CYmLWfsWURrrK2qEeSz6wTeDeiVAVGkSraYIgyZAIJpZGjX/4m0slH7N2fpnHcLV6pCoayClk/8B E/WdPXe753rrORAL0rx7z+ARaeIQydY73MsyGcI809ZGaaNx2Bn4KMmSKVtF/GLqU/o8LvaNWGfz2 tZTQz334ZbJkZlF6PVFmzR6W4FDtOw4CrF3zt3MLOFkRYCE62Utj9HRRM3IQpAeOF91lMbwLdLoRb zVAAJcDw==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXst-00081K-Mi; Tue, 29 Jan 2019 18:13:20 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/8] parisc: move internal implementation details out of Date: Tue, 29 Jan 2019 19:13:04 +0100 Message-Id: <20190129181310.5557-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move everything that is not required for the public facing DMA API out of and into a new drivers/parisc/iommu.h header. Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/dma-mapping.h | 44 ----------------------- drivers/parisc/ccio-dma.c | 2 ++ drivers/parisc/dino.c | 1 + drivers/parisc/eisa.c | 2 ++ drivers/parisc/hppb.c | 2 ++ drivers/parisc/iommu.h | 51 +++++++++++++++++++++++++++ drivers/parisc/lba_pci.c | 2 ++ drivers/parisc/sba_iommu.c | 2 ++ 8 files changed, 62 insertions(+), 44 deletions(-) create mode 100644 drivers/parisc/iommu.h diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index f1bf5e297f1c..d5bd94247371 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h @@ -26,48 +26,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) return hppa_dma_ops; } -static inline void * -parisc_walk_tree(struct device *dev) -{ - struct device *otherdev; - if(likely(dev->platform_data != NULL)) - return dev->platform_data; - /* OK, just traverse the bus to find it */ - for(otherdev = dev->parent; otherdev; - otherdev = otherdev->parent) { - if(otherdev->platform_data) { - dev->platform_data = otherdev->platform_data; - break; - } - } - return dev->platform_data; -} - -#define GET_IOC(dev) ({ \ - void *__pdata = parisc_walk_tree(dev); \ - __pdata ? HBA_DATA(__pdata)->iommu : NULL; \ -}) - -#ifdef CONFIG_IOMMU_CCIO -struct parisc_device; -struct ioc; -void * ccio_get_iommu(const struct parisc_device *dev); -int ccio_request_resource(const struct parisc_device *dev, - struct resource *res); -int ccio_allocate_resource(const struct parisc_device *dev, - struct resource *res, unsigned long size, - unsigned long min, unsigned long max, unsigned long align); -#else /* !CONFIG_IOMMU_CCIO */ -#define ccio_get_iommu(dev) NULL -#define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res) -#define ccio_allocate_resource(dev, res, size, min, max, align) \ - allocate_resource(&iomem_resource, res, size, min, max, \ - align, NULL, NULL) -#endif /* !CONFIG_IOMMU_CCIO */ - -#ifdef CONFIG_IOMMU_SBA -struct parisc_device; -void * sba_get_iommu(struct parisc_device *dev); -#endif - #endif diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 8d2fc84119c6..b17e81cf77d5 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -55,6 +55,8 @@ #include /* for register_module() */ #include +#include "iommu.h" + /* ** Choose "ccio" since that's what HP-UX calls it. ** Make it easier for folks to migrate from one to the other :^) diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index dfeea458a789..6f348c75687c 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -59,6 +59,7 @@ #include #include "gsc.h" +#include "iommu.h" #undef DINO_DEBUG diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 9ff434f354bd..5657a1d3eb2b 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -45,6 +45,8 @@ #include #include +#include "iommu.h" + #if 0 #define EISA_DBG(msg, arg...) printk(KERN_DEBUG "eisa: " msg, ## arg) #else diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c index ebc7b617e5d0..3b3481c0d81d 100644 --- a/drivers/parisc/hppb.c +++ b/drivers/parisc/hppb.c @@ -23,6 +23,8 @@ #include #include +#include "iommu.h" + struct hppb_card { unsigned long hpa; struct resource mmio_region; diff --git a/drivers/parisc/iommu.h b/drivers/parisc/iommu.h new file mode 100644 index 000000000000..5a38b635e963 --- /dev/null +++ b/drivers/parisc/iommu.h @@ -0,0 +1,51 @@ +#ifndef _IOMMU_H +#define _IOMMU_H 1 + +#include + +struct parisc_device; +struct ioc; + +static inline void *parisc_walk_tree(struct device *dev) +{ + struct device *otherdev; + + if (likely(dev->platform_data)) + return dev->platform_data; + + /* OK, just traverse the bus to find it */ + for (otherdev = dev->parent; + otherdev; + otherdev = otherdev->parent) { + if (otherdev->platform_data) { + dev->platform_data = otherdev->platform_data; + break; + } + } + + return dev->platform_data; +} + +#define GET_IOC(dev) ({ \ + void *__pdata = parisc_walk_tree(dev); \ + __pdata ? HBA_DATA(__pdata)->iommu : NULL; \ +}) + +#ifdef CONFIG_IOMMU_CCIO +void *ccio_get_iommu(const struct parisc_device *dev); +int ccio_request_resource(const struct parisc_device *dev, + struct resource *res); +int ccio_allocate_resource(const struct parisc_device *dev, + struct resource *res, unsigned long size, + unsigned long min, unsigned long max, unsigned long align); +#else /* !CONFIG_IOMMU_CCIO */ +#define ccio_get_iommu(dev) NULL +#define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res) +#define ccio_allocate_resource(dev, res, size, min, max, align) \ + allocate_resource(&iomem_resource, res, size, min, max, \ + align, NULL, NULL) +#endif /* !CONFIG_IOMMU_CCIO */ + +void *sba_get_iommu(struct parisc_device *dev); + +#endif /* _IOMMU_H */ diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 69bd98421eb1..63e9bc6d18de 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -49,6 +49,8 @@ #include #include /* read/write stuff */ +#include "iommu.h" + #undef DEBUG_LBA /* general stuff */ #undef DEBUG_LBA_PORT /* debug I/O Port access */ #undef DEBUG_LBA_CFG /* debug Config Space Access (ie PCI Bus walk) */ diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 42172eb32235..afaf8e6aefe6 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -49,6 +49,8 @@ #include /* for is_pdc_pat() */ #include +#include "iommu.h" + #define MODULE_NAME "SBA" /* From patchwork Tue Jan 29 18:13:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786805 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 40F05139A for ; Tue, 29 Jan 2019 18:13:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E6A42CBF2 for ; Tue, 29 Jan 2019 18:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21B332CC2B; Tue, 29 Jan 2019 18:13:54 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B21D02CBF2 for ; Tue, 29 Jan 2019 18:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbfA2SN0 (ORCPT ); Tue, 29 Jan 2019 13:13:26 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35150 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbfA2SNZ (ORCPT ); Tue, 29 Jan 2019 13:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3EpTLPTe7MxqR7rhIW83gWtXzmEP4UKkgI2JifEq9Rc=; b=h9nnQF0QAAvN7pvGRn62DMEsNk AxSGH6uiqzCT/H1UNvdMnvEj0gGKRwMMFNDhRhSf70lKsuir2NIE0OeJ4/Jxw4jLeTzm+qj4ROl2d lbXbGHhBCCwVzVF3eq2dotCD7QXeCtKcmJMKpIOZ5LuLcdEWSJ5hmRUZ/yW6kQV/D1S27no21yZ/u 3dlvDQaNSVckyWD89eyhjQElAeReT15XqJIyiSgjtfJWIoDn5wGcMjKpzeZ3M3ezUMxavWG7WpSjo 7GUR1IAC5dodo3ogK5uIA2Djeg7UC6flP+eZ7ieu8kcbNEDA4QI0ZCp8cdRo82WPNOQwtNTkGCzBe GTeQgIfg==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXsw-00082N-Qx; Tue, 29 Jan 2019 18:13:23 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] parisc: turn GET_IOC into an inline function Date: Tue, 29 Jan 2019 19:13:05 +0100 Message-Id: <20190129181310.5557-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the function both more readable and more typesafe. Signed-off-by: Christoph Hellwig --- drivers/parisc/iommu.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/parisc/iommu.h b/drivers/parisc/iommu.h index 5a38b635e963..d6fd3ab899ac 100644 --- a/drivers/parisc/iommu.h +++ b/drivers/parisc/iommu.h @@ -26,10 +26,14 @@ static inline void *parisc_walk_tree(struct device *dev) return dev->platform_data; } -#define GET_IOC(dev) ({ \ - void *__pdata = parisc_walk_tree(dev); \ - __pdata ? HBA_DATA(__pdata)->iommu : NULL; \ -}) +static inline struct ioc *GET_IOC(struct device *dev) +{ + struct pci_hba_data *pdata = parisc_walk_tree(dev); + + if (!pdata) + return NULL; + return pdata->iommu; +} #ifdef CONFIG_IOMMU_CCIO void *ccio_get_iommu(const struct parisc_device *dev); From patchwork Tue Jan 29 18:13:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786795 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 02CE3139A for ; Tue, 29 Jan 2019 18:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E66352D861 for ; Tue, 29 Jan 2019 18:13:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAE0D2DADD; Tue, 29 Jan 2019 18:13:32 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 801512D861 for ; Tue, 29 Jan 2019 18:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbfA2SN1 (ORCPT ); Tue, 29 Jan 2019 13:13:27 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35158 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbfA2SN1 (ORCPT ); Tue, 29 Jan 2019 13:13:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yBOfS/1RGs0Iv7Q/HqrXI7lqeT5eZT0y7JFIpYqjL+g=; b=Bv3TAi+7OVUu9LN8s3D/LcQByB KIuCi9YOG4N0UIotJ/gr7TttW5w4YKED3IuYnAR5XSGiN0AoCn5qpK8vGjT3El4JOQhs1e7MU+x2M dNYcUutQoaU7DZdcglUz42ElUxGukSLtSCRzZ7aG0KVqGFjT2sIwr7zZc32TbjFPdrIc4Fz3wOfri ERgk0JVf/FTz5HlVwEhljRo9MhDKkLBFN/fQfDbGNbV/i3GiBKtJnpstKsAJrPnN+QtE6kDhDaYfl AoJFPLHiycBkrZahDFhSKg1QuQ6/anq41MOZkO8V8Fmw+iGduCZt+8frEkCS4TJVPHPeefrwCTxmH LzzoAUhA==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXsz-00082u-MN; Tue, 29 Jan 2019 18:13:26 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] parisc: properly type the iommu field in struct pci_hba_data Date: Tue, 29 Jan 2019 19:13:06 +0100 Message-Id: <20190129181310.5557-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 3328fd17c19d..00f763688401 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h @@ -56,7 +56,7 @@ struct pci_hba_data { #define DINO_MAX_LMMIO_RESOURCES 3 unsigned long lmmio_space_offset; /* CPU view - PCI view */ - void * iommu; /* IOMMU this device is under */ + struct ioc *iommu; /* IOMMU this device is under */ /* REVISIT - spinlock to protect resources? */ #define HBA_NAME_SIZE 16 From patchwork Tue Jan 29 18:13:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786797 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 22318184E for ; Tue, 29 Jan 2019 18:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 106012DAB0 for ; Tue, 29 Jan 2019 18:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 045542D861; Tue, 29 Jan 2019 18:13:32 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0A8B2DAB0 for ; Tue, 29 Jan 2019 18:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729261AbfA2SNc (ORCPT ); Tue, 29 Jan 2019 13:13:32 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35172 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbfA2SNa (ORCPT ); Tue, 29 Jan 2019 13:13:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iGY/6/uIkSQ/SVnkOTP7iJDc4IYtHZf3o7I5f03/Vb0=; b=qHFDx39McKnwRZB2F3+5Lw4q+K M9o+8wqN8BM2nbq9dUZIcgvUiOoDUFQg+92sXiE6ycpZBa0/meqYk61AQyCjm5MtAEJe7KUWqMRoF i/8pnblYBpMQQAKyJB1ACJiX/N99Czwm4WYNZkQ8ECAvwD8vX1lVQNee3mh7lVAl6uvpwWwFJN/um l1U8D6c9j7/4qU4AtJ24PE449XqLRMtDBtgSrarToMoRs451SNkUOw/HUta8ROddleiIOYjgJzR2u W2C/tdA274SvweREak03vfWQ9F2THhvUYryQcpb7rWYOwH/3RDW8aG2CW14gJ5ve640ayMQon/ffP 20OIObOw==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXt2-000836-IG; Tue, 29 Jan 2019 18:13:28 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] parisc: properly type the return value of parisc_walk_tree Date: Tue, 29 Jan 2019 19:13:07 +0100 Message-Id: <20190129181310.5557-6-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Christoph Hellwig --- drivers/parisc/iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/parisc/iommu.h b/drivers/parisc/iommu.h index d6fd3ab899ac..240059cd8185 100644 --- a/drivers/parisc/iommu.h +++ b/drivers/parisc/iommu.h @@ -6,7 +6,7 @@ struct parisc_device; struct ioc; -static inline void *parisc_walk_tree(struct device *dev) +static inline struct pci_hba_data *parisc_walk_tree(struct device *dev) { struct device *otherdev; From patchwork Tue Jan 29 18:13:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786803 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 C7EB9139A for ; Tue, 29 Jan 2019 18:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B34B02C89A for ; Tue, 29 Jan 2019 18:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A36C82CA5B; Tue, 29 Jan 2019 18:13:49 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 327AC2D462 for ; Tue, 29 Jan 2019 18:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728682AbfA2SNf (ORCPT ); Tue, 29 Jan 2019 13:13:35 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35188 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729282AbfA2SNc (ORCPT ); Tue, 29 Jan 2019 13:13:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GSD9JLapBWqIj3ABdywFRH0m0lA8Ni+ahzMil/WnITY=; b=W8zUlumoTZhKLGRBXkwh4iE64S o8q8JjBE37//KO7xfp/vBLj/S+3/AI8cbpOIdr+Cm0FPjz1gNe4tuEIScmj1AG6R6tWYv4+5yXFLd Ga1mK0EjCPwyiqYwpZNqJH1rWSqd4zLHrYEpJxio+W5yhhNvTCTbvzTgiXrvJ0zaZl+EFRmLlDXXf BiY+LNVqJbYXtIoocOS7iQeACz2G7tCModjuKESH72rDUS0WaXIY76fN57w7av5pQf8hQY1PFW4a1 S11irsu8Ae5ZmD9F5hqnNZ7E3gxQHtLR/1S5mlNotoUlQU6a7hZ8kfYJQf0rxayoS++HWvT4zxRdt LrPLVQ/A==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXt5-00083d-Ar; Tue, 29 Jan 2019 18:13:31 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] parisc/dino: use container_of in DINO_DEV Date: Tue, 29 Jan 2019 19:13:08 +0100 Message-Id: <20190129181310.5557-7-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the type safe container_of macros instead of a blind cast in DINO_DEV, and turn the macro into an inline function. Signed-off-by: Christoph Hellwig --- drivers/parisc/dino.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 6f348c75687c..846b59d15999 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -154,12 +154,10 @@ struct dino_device #endif }; -/* Looks nice and keeps the compiler happy */ -#define DINO_DEV(d) ({ \ - void *__pdata = d; \ - BUG_ON(!__pdata); \ - (struct dino_device *)__pdata; }) - +static inline struct dino_device *DINO_DEV(struct pci_hba_data *hba) +{ + return container_of(hba, struct dino_device, hba); +} /* * Dino Configuration Space Accessor Functions From patchwork Tue Jan 29 18:13:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786801 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 D12871399 for ; Tue, 29 Jan 2019 18:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFAE32DAB0 for ; Tue, 29 Jan 2019 18:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1D2D2DAFA; Tue, 29 Jan 2019 18:13:47 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6171C2DAB0 for ; Tue, 29 Jan 2019 18:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729310AbfA2SNg (ORCPT ); Tue, 29 Jan 2019 13:13:36 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35196 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfA2SNf (ORCPT ); Tue, 29 Jan 2019 13:13:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hxJVZs5E5cqhZZjBbmbtMAt19nHoSSZSpcr7hJeAg2Y=; b=mYsuKXQr79fxlJrSvGtCwDV8E1 dhxibgSIOMRegtyTswexxJhCjvzrpdbr9pREJTtsxREsqFB0bso2v33ZKyN8EldUZJ1t8d5Tlxc2Z XkRwTajyGgTRTxGK+07p+cBWoHz6puijpOCZsTNBCRvESHTwHg1T7M9z0cBkj4hx1Soa6s7VRkIJ1 gTsYRVFVjq24E6/2JlfGx7SwRwhf+pGHwog33lHkkv5quxzPXkJExomaTNcVOvK1dyP1Y13z5dFDR Yi8BTKlqkie173930ESkOi1DR3Usb7xWzvpDZSwrhExoaxcnJ6m1d7CzBtIMaWHap8SlNWMbfBBkS CX3d9NFQ==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXt8-00084P-9r; Tue, 29 Jan 2019 18:13:34 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] parisc/lba_pci: use container_of in LBA_DEV Date: Tue, 29 Jan 2019 19:13:09 +0100 Message-Id: <20190129181310.5557-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the type safe container_of macros instead of a blind cast in LBA_DEV, and turn the macro into an inline function. Signed-off-by: Christoph Hellwig --- drivers/parisc/lba_pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 63e9bc6d18de..065d88868402 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -111,12 +111,10 @@ static u32 lba_t32; #define LBA_SKIP_PROBE(d) ((d)->flags & LBA_FLAG_SKIP_PROBE) - -/* Looks nice and keeps the compiler happy */ -#define LBA_DEV(d) ({ \ - void *__pdata = d; \ - BUG_ON(!__pdata); \ - (struct lba_device *)__pdata; }) +static inline struct lba_device *LBA_DEV(struct pci_hba_data *hba) +{ + return container_of(hba, struct lba_device, hba); +} /* ** Only allow 8 subsidiary busses per LBA From patchwork Tue Jan 29 18:13:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10786799 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 339BC1399 for ; Tue, 29 Jan 2019 18:13:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 217852D861 for ; Tue, 29 Jan 2019 18:13:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 159F22DADD; Tue, 29 Jan 2019 18:13:44 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 919952D861 for ; Tue, 29 Jan 2019 18:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729332AbfA2SNi (ORCPT ); Tue, 29 Jan 2019 13:13:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35206 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727918AbfA2SNi (ORCPT ); Tue, 29 Jan 2019 13:13:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xBAJp7P+SRrVIpBj+imQoJVibRelvsQITaxQpmd4yu8=; b=IfuYX16wx0s162p8oT3vThP9q7 7zp+isgn2cWSRvCn82BM2DokrI2pL+tKqiFH4ISqOTWomr1uPwMsX2+hQaW/SC+xAGd6NRt93/Qme fcTkdsCECQ7JUkQGj5FYTio/CAsaGwbWOGQRG/9UGhpZ3n+LCxEKuk+HEs5440KYO2HEKmKRfFxWG +HRhmDsJvzqpqSGJwVdBNyImQLK4yWKbuem+RceJsMlThOvhKx5ba2mlzBxzSTTjg0BrOn18r7aZx LiNsouhPkdSyYqt56Zx7EqoRuTFrOq65WTIMlcEVdTCMhxfrjbjGjd1AlbFfxtztuOeGNZS76w8o7 5r8QcHrw==; Received: from 213-225-35-141.nat.highway.a1.net ([213.225.35.141] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goXtB-00084Z-58; Tue, 29 Jan 2019 18:13:37 +0000 From: Christoph Hellwig To: "James E.J. Bottomley" , Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] parisc: remove the HBA_DATA macro Date: Tue, 29 Jan 2019 19:13:10 +0100 Message-Id: <20190129181310.5557-9-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129181310.5557-1-hch@lst.de> References: <20190129181310.5557-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No need to hide a cast in a macro, especially as all users have cleaner ways to archive the result than blind casting. Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/pci.h | 2 -- drivers/parisc/ccio-dma.c | 9 ++++++--- drivers/parisc/lba_pci.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 00f763688401..f14465b84de4 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h @@ -66,8 +66,6 @@ struct pci_hba_data { char gmmio_name[HBA_NAME_SIZE]; }; -#define HBA_DATA(d) ((struct pci_hba_data *) (d)) - /* ** We support 2^16 I/O ports per HBA. These are set up in the form ** 0xbbxxxx, where bb is the bus number and xxxx is the I/O port diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index b17e81cf77d5..097b0d43d13c 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1519,6 +1519,7 @@ static int __init ccio_probe(struct parisc_device *dev) { int i; struct ioc *ioc, **ioc_p = &ioc_list; + struct pci_hba_data *hba; ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); if (ioc == NULL) { @@ -1545,11 +1546,13 @@ static int __init ccio_probe(struct parisc_device *dev) ccio_ioc_init(ioc); ccio_init_resources(ioc); hppa_dma_ops = &ccio_ops; - dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL); + hba = kzalloc(sizeof(*hba), GFP_KERNEL); /* if this fails, no I/O cards will work, so may as well bug */ - BUG_ON(dev->dev.platform_data == NULL); - HBA_DATA(dev->dev.platform_data)->iommu = ioc; + BUG_ON(hba == NULL); + + hba->iommu = ioc; + dev->dev.platform_data = hba; #ifdef CONFIG_PROC_FS if (ioc_count == 0) { diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 065d88868402..9047cc22c155 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1275,7 +1275,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) r->flags = IORESOURCE_MEM; /* mmio_mask also clears Enable bit */ r->start &= mmio_mask; - r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start); + r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start); rsize = ~ READ_REG32(lba_dev->hba.base_addr + LBA_LMMIO_MASK); /* @@ -1321,7 +1321,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) r->flags = IORESOURCE_MEM; /* mmio_mask also clears Enable bit */ r->start &= mmio_mask; - r->start = PCI_HOST_ADDR(HBA_DATA(lba_dev), r->start); + r->start = PCI_HOST_ADDR(&lba_dev->hba, r->start); rsize = READ_REG32(lba_dev->hba.base_addr + LBA_ELMMIO_MASK); r->end = r->start + ~rsize; } @@ -1562,7 +1562,7 @@ lba_driver_probe(struct parisc_device *dev) /* ------------ Second : initialize common stuff ---------- */ pci_bios = &lba_bios_ops; - pcibios_register_hba(HBA_DATA(lba_dev)); + pcibios_register_hba(&lba_dev->hba); spin_lock_init(&lba_dev->lba_lock); if (lba_hw_init(lba_dev))