From patchwork Mon Jan 14 11:23:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762217 X-Patchwork-Delegate: deller@gmx.de 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 319511390 for ; Mon, 14 Jan 2019 11:24:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22EEA1FE82 for ; Mon, 14 Jan 2019 11:24:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16E87286B1; Mon, 14 Jan 2019 11:24:03 +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 B36AF1FE82 for ; Mon, 14 Jan 2019 11:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfANLYB (ORCPT ); Mon, 14 Jan 2019 06:24:01 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38566 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbfANLYA (ORCPT ); Mon, 14 Jan 2019 06:24:00 -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=l4TwRe8mhPu2NMzvmn3AZgmtKR shruT8GqkIK+kR/4KVpRXNwL4AHD5lqkV+zOcIXmriPEXooUXZevTdWuc/6MJHhncrGhLL5E90D9Q CggxlXTQu2pDQmOqoyJmbqM85W47M24I6hJd38Bptmx9QAzQ2SzX+ysB5FS/VTYqCyiihCo/ZbOqx Y9Ddhy1+TPo0cmAD/eADo+2u/ASkGdJn3ef0CWSHDEtmv/a/Nj5+Zl09lSDYuq2a7YSb6niFWyf2Z +oA2+aM8EnBGKswBL3XD5Hk6vr4ixiuE8hzDQQLW9WhQCB/2QjJP7rgRTKkq75ODeL8jGU3M9pIeA kK6m/Wbg==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0LW-0006oT-LT; Mon, 14 Jan 2019 11:23:59 +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: Mon, 14 Jan 2019 12:23:46 +0100 Message-Id: <20190114112353.30616-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 Mon Jan 14 11:23:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762249 X-Patchwork-Delegate: deller@gmx.de 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 008A11390 for ; Mon, 14 Jan 2019 11:24:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E50DF286A9 for ; Mon, 14 Jan 2019 11:24:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D956528821; Mon, 14 Jan 2019 11:24:48 +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 474FE286A9 for ; Mon, 14 Jan 2019 11:24:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfANLYD (ORCPT ); Mon, 14 Jan 2019 06:24:03 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38574 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbfANLYD (ORCPT ); Mon, 14 Jan 2019 06:24:03 -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=qs0Wt/vtsahTKQl6GXCP+v4YOJy8sonRA2AI/tUvugQ=; b=VSc1nxR4bEBizFRH2KYQJvoxRF /+g2LaR5Np1AmREr/+nugNs2x5iSmQDUDOlBDYt8tOjh4K61adVmuoPWHjfbAp9UjxsYglxY389Ym A/qA3gDD/ii/JCCWzbYrk9CmMxU95nw7m9RcNBZAWYuEW01k1RIu7ugxDF2ApPOW0tEwvMYklznfB Sj74zGwEbrk7Igq9omHLMRW+P0+eDpu/LoUw06NEW/14x/Im2G3SQsUGbJN9+q+FY0KVT/S+x3f4O VdWfMZsEbAvlbY+XmIGb6U298sh5YuaOvWXhtLSFSR+LSFhwZ1BoUBkjd6sGP03PJ7uhQqQElz901 YDSBsm9A==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0LZ-0006od-KL; Mon, 14 Jan 2019 11:24:02 +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: Mon, 14 Jan 2019 12:23:47 +0100 Message-Id: <20190114112353.30616-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 | 49 +++++++++++++++++++++++++++ drivers/parisc/lba_pci.c | 2 ++ drivers/parisc/sba_iommu.c | 2 ++ 8 files changed, 60 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..c72c4fe51a3a --- /dev/null +++ b/drivers/parisc/iommu.h @@ -0,0 +1,49 @@ +#ifndef _IOMMU_H +#define _IOMMU_H 1 + +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 Mon Jan 14 11:23:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762245 X-Patchwork-Delegate: deller@gmx.de 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 B43776C2 for ; Mon, 14 Jan 2019 11:24:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6C48286A9 for ; Mon, 14 Jan 2019 11:24:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B50828821; Mon, 14 Jan 2019 11:24:43 +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 4677E286A9 for ; Mon, 14 Jan 2019 11:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbfANLYG (ORCPT ); Mon, 14 Jan 2019 06:24:06 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38582 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbfANLYF (ORCPT ); Mon, 14 Jan 2019 06:24:05 -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=rwYRd+z2rpdVxb5xbqYdl+l6tXhoDRduewfCcAC9o5A=; b=BKOUwrxOuyQuG+rcZovQMzzIoB C0lGPMZZWbvOoJDAyXlihJdPayGvqfldy/5HL3qg4rG+NvgQ9BWjlzBnKIALWF9yHdRiacrp3EPuc 1LY07MC3kxeQCxai2JkN9Dcq9V8dq3W1C30gnL/p9EuUZ/sI56ZGNqQRXfns9EepeyG7Zxl3SKvvg DkDuJIDJSAfnsmr5mAChGKeAB9V5s+Hmn3dwiXyipYyuIQspfSSYMHquWYDhmgdheThbchgFPrkDA m9eR3HLJ9urFuuIJ3/pDiv4Gr5KMmfpWk418JL8O7XXrJStN6AbJzoF8efEetRjuAX0s4YcmJimfn fqM658nw==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Lc-0006ow-Fm; Mon, 14 Jan 2019 11:24:04 +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: Mon, 14 Jan 2019 12:23:48 +0100 Message-Id: <20190114112353.30616-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 c72c4fe51a3a..94d5eae98bf6 100644 --- a/drivers/parisc/iommu.h +++ b/drivers/parisc/iommu.h @@ -24,10 +24,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 Mon Jan 14 11:23:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762243 X-Patchwork-Delegate: deller@gmx.de 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 5C0C81580 for ; Mon, 14 Jan 2019 11:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C364286BD for ; Mon, 14 Jan 2019 11:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4052C289B1; Mon, 14 Jan 2019 11:24:42 +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 E2925286BD for ; Mon, 14 Jan 2019 11:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726753AbfANLYK (ORCPT ); Mon, 14 Jan 2019 06:24:10 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38594 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfANLYI (ORCPT ); Mon, 14 Jan 2019 06:24:08 -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=ikOlQLUm23BBqFqxlXWvj7wKyE ERSQAGQqRu6gUb3Ue6L6KfdKDGD9pZcD2tZnJJK4clr6fBXkXbZVLZxvTB9wpzE4XFI/dcruyUlpF ch6RuIokEa/lJo+OnDMw7+RyCRJvGaGg4Np85SGQxiJ4qFlUN6RSJWMIBx9ltAiwHVDdlioGDGpDA VmAseyIUdgT3ubscE05DAuMBduMEJm6Q73UhuXQoZQF65i5Dz6trTaOjY64mlmov3dXpf0ywPDn4U Cq2eSmnKsd10ZBzc0u/kbBU8robQr9M5jyZfO/RpX5m9SBR9ZO48jfWiJ3qn8c/gRKfKzoSexJfxr SnC3nnTQ==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Lf-0006p6-Ag; Mon, 14 Jan 2019 11:24:07 +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: Mon, 14 Jan 2019 12:23:49 +0100 Message-Id: <20190114112353.30616-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 Mon Jan 14 11:23:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762237 X-Patchwork-Delegate: deller@gmx.de 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 188AA1390 for ; Mon, 14 Jan 2019 11:24:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09CB4286A9 for ; Mon, 14 Jan 2019 11:24:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F248A28821; Mon, 14 Jan 2019 11:24:39 +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 94DB4286A9 for ; Mon, 14 Jan 2019 11:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbfANLYd (ORCPT ); Mon, 14 Jan 2019 06:24:33 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfANLYL (ORCPT ); Mon, 14 Jan 2019 06:24:11 -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=ZnYaNa35JC9qpQE/YlWcltLKGzLnKT/DBn293o4oqlo=; b=uUPTHjvPaX1FVVpqcI6T+7J1b1 bJYoB3iW9fKqdGgkIlzpzyx0ZeO6z5Pq2kRSaDEHC3QlV2mi7KjVJCKdbqEnz+YvRRuIgXnnDYNLK p+7ATqzCWOkabWnOs9kIdxbcrvdLopxn1tFsiAQxZSWKkiY5xVX/+6SYKN5y57klLdgeQMvWehBc5 zxyDf0ebE4bb3yvJd87CjxwcknqmlRSYSTxAGLRPIgQOTmnENYVhu6yCO2/0SiQD0G5EV7Xoq5dv/ 9+Z1rMzCNpKVsYn5SvPiPWcb2GNOn5bUzuVczIgzPstME7s3fezt1fcw3Tu4FwdQpVXBxpSZcbfHr cwUZ2lPA==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Li-0006pU-Af; Mon, 14 Jan 2019 11:24:10 +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: Mon, 14 Jan 2019 12:23:50 +0100 Message-Id: <20190114112353.30616-6-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 94d5eae98bf6..010539fc4643 100644 --- a/drivers/parisc/iommu.h +++ b/drivers/parisc/iommu.h @@ -4,7 +4,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 Mon Jan 14 11:23:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762231 X-Patchwork-Delegate: deller@gmx.de 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 9912A1390 for ; Mon, 14 Jan 2019 11:24:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F74286A9 for ; Mon, 14 Jan 2019 11:24:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E81F28821; Mon, 14 Jan 2019 11:24: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=-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 342E5286A9 for ; Mon, 14 Jan 2019 11:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbfANLYP (ORCPT ); Mon, 14 Jan 2019 06:24:15 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38612 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfANLYO (ORCPT ); Mon, 14 Jan 2019 06:24:14 -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=YQE73UDb8Y0GMPdlkC7x2EAgxO S1vtF+JlOotjnAP06srMWRFXHs8vFG7uSJpMX1LjCkwg77k2cxzKqRrcQkj5sJc/19RxW90t9rdoa vsYc1UgNsvMXUrZCpI5ge1MhbKmFbJc06LYAL/4m8qJAyq26fGyEnaelb9zOfQN4g6BGIwmsuQE8o bALXov3Zg8Uyqc01P3sL+An5tkLGXrdQEZIFuYCtVhWoUyynLNEKpN/8IEduCrq+X7cLlFBmXuoZR e3p/i65bT8JRssB278EjPgsPeolwCZVgU6x1SjZyLHYhvvGzKHQvRbHFlXpg6uPfVX1UBRnzvDHwv NsqOHiqw==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Ll-0006pc-9X; Mon, 14 Jan 2019 11:24:13 +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: Mon, 14 Jan 2019 12:23:51 +0100 Message-Id: <20190114112353.30616-7-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 Mon Jan 14 11:23:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762225 X-Patchwork-Delegate: deller@gmx.de 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 722316C2 for ; Mon, 14 Jan 2019 11:24:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62E2D286A9 for ; Mon, 14 Jan 2019 11:24:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56C4028821; Mon, 14 Jan 2019 11:24:30 +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 0203C286A9 for ; Mon, 14 Jan 2019 11:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbfANLYS (ORCPT ); Mon, 14 Jan 2019 06:24:18 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38618 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfANLYR (ORCPT ); Mon, 14 Jan 2019 06:24:17 -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=alL/pEIWiVg0fY5r5VB7ZtHs4U Tmju0HeoyRhGfjNebbF3/HSLq1TGyH69vAmsf23chYr2JZBgnkdaCzLBIo+D+79+uskYhuxZ0ef7j hOdzgNRtH1/z5k0g4nUTordV+IvS8AoIwcpVLd9DI6tPxaI7zjxBF1nLc1ORkVlVtiOhMd+350uM3 9QGUTGJwrFrEWVph7UpANcviBdwDCNNXWojQGRRyRo7tizYOiC7KYFaohbotVSJNuoCi4I51TkDX8 qw2Nr2/6EYrp6rt5BFeTuDjvdIIElZ3PJyLNm5pq8tCYOeFGvJ+gVaMwYpc5lWs7YhYvgGWNPjiR8 3NhQZK2w==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Lo-0006pl-5E; Mon, 14 Jan 2019 11:24: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 7/8] parisc/lba_pci: use container_of in LBA_DEV Date: Mon, 14 Jan 2019 12:23:52 +0100 Message-Id: <20190114112353.30616-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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 Mon Jan 14 11:23:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10762223 X-Patchwork-Delegate: deller@gmx.de 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 E170D1580 for ; Mon, 14 Jan 2019 11:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3855286A9 for ; Mon, 14 Jan 2019 11:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C57CB289DA; Mon, 14 Jan 2019 11:24:28 +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 4C211286BD for ; Mon, 14 Jan 2019 11:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbfANLYW (ORCPT ); Mon, 14 Jan 2019 06:24:22 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38624 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbfANLYU (ORCPT ); Mon, 14 Jan 2019 06:24:20 -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=Tcb+T8ScrhN+H3Bw7p9hQ4wu2i 8OsQCgtZqdXR+5EABqZc1TWv7vSMGdz6yydB0g0UiGdN76TTQBwwanJVFAKXxwZovjyAp7P5JZxJ0 Nq8e+VOhW2xK5qtpUjQmdOGJlfFNdcuH2ZqHHL5/KRtfLDuIOMwQnzxTLlNAqBAs8p+no1kgPmj9g EB58cr5i4n0yUsOLcswSvkfibwm09nadTBp204AZCHWqRo+hn/QUiXGn0ACHn2w4oZyF8XtT/BzOr ZKnflbcHs0mzJOzSiBkLXmPpv9Ebf5++FdVt4WOQzu/aKqsNc9JE7Le9Uo88mB3lUiyWMKYPAtPH6 ngS+e3Xw==; Received: from 089144213167.atnat0022.highway.a1.net ([89.144.213.167] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj0Lr-0006pt-6m; Mon, 14 Jan 2019 11:24:19 +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: Mon, 14 Jan 2019 12:23:53 +0100 Message-Id: <20190114112353.30616-9-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114112353.30616-1-hch@lst.de> References: <20190114112353.30616-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))