linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "James E.J. Bottomley" <jejb@parisc-linux.org>,
	Helge Deller <deller@gmx.de>
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	[thread overview]
Message-ID: <20190129181310.5557-9-hch@lst.de> (raw)
In-Reply-To: <20190129181310.5557-1-hch@lst.de>

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 <hch@lst.de>
---
 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))
-- 
2.20.1


  parent reply	other threads:[~2019-01-29 18:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 18:13 DMA-related cleanups for parisc v2 Christoph Hellwig
2019-01-29 18:13 ` [PATCH 1/8] parisc: don't include <asm/cacheflush.h> in <asm/dma-mapping.h> Christoph Hellwig
2019-01-29 18:13 ` [PATCH 2/8] parisc: move internal implementation details out of <asm/dma-mapping.h> Christoph Hellwig
2019-01-29 18:13 ` [PATCH 3/8] parisc: turn GET_IOC into an inline function Christoph Hellwig
2019-01-29 18:13 ` [PATCH 4/8] parisc: properly type the iommu field in struct pci_hba_data Christoph Hellwig
2019-01-29 18:13 ` [PATCH 5/8] parisc: properly type the return value of parisc_walk_tree Christoph Hellwig
2019-01-29 18:13 ` [PATCH 6/8] parisc/dino: use container_of in DINO_DEV Christoph Hellwig
2019-01-29 18:13 ` [PATCH 7/8] parisc/lba_pci: use container_of in LBA_DEV Christoph Hellwig
2019-01-29 18:13 ` Christoph Hellwig [this message]
2019-01-29 19:21 ` DMA-related cleanups for parisc v2 Helge Deller
  -- strict thread matches above, loose matches on Subject: below --
2019-01-14 11:23 DMA-related cleanups for parisc Christoph Hellwig
2019-01-14 11:23 ` [PATCH 8/8] parisc: remove the HBA_DATA macro Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190129181310.5557-9-hch@lst.de \
    --to=hch@lst.de \
    --cc=deller@gmx.de \
    --cc=jejb@parisc-linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).