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))