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 3/8] parisc: turn GET_IOC into an inline function
Date: Mon, 14 Jan 2019 12:23:48 +0100	[thread overview]
Message-ID: <20190114112353.30616-4-hch@lst.de> (raw)
In-Reply-To: <20190114112353.30616-1-hch@lst.de>

This makes the function both more readable and more typesafe.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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);
-- 
2.20.1


  parent reply	other threads:[~2019-01-14 11:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 11:23 DMA-related cleanups for parisc Christoph Hellwig
2019-01-14 11:23 ` [PATCH 1/8] parisc: don't include <asm/cacheflush.h> in <asm/dma-mapping.h> Christoph Hellwig
2019-01-14 11:23 ` [PATCH 2/8] parisc: move internal implementation details out of <asm/dma-mapping.h> Christoph Hellwig
2019-01-14 11:23 ` Christoph Hellwig [this message]
2019-01-14 23:32   ` [PATCH 3/8] parisc: turn GET_IOC into an inline function kbuild test robot
2019-01-14 11:23 ` [PATCH 4/8] parisc: properly type the iommu field in struct pci_hba_data Christoph Hellwig
2019-01-14 11:23 ` [PATCH 5/8] parisc: properly type the return value of parisc_walk_tree Christoph Hellwig
2019-01-14 11:23 ` [PATCH 6/8] parisc/dino: use container_of in DINO_DEV Christoph Hellwig
2019-01-14 11:23 ` [PATCH 7/8] parisc/lba_pci: use container_of in LBA_DEV Christoph Hellwig
2019-01-14 11:23 ` [PATCH 8/8] parisc: remove the HBA_DATA macro Christoph Hellwig
2019-01-26 17:11 ` DMA-related cleanups for parisc Helge Deller
2019-01-28  7:34   ` Christoph Hellwig
2019-01-29 18:06     ` Helge Deller
2019-01-29 18:12       ` Christoph Hellwig
2019-01-29 18:13 DMA-related cleanups for parisc v2 Christoph Hellwig
2019-01-29 18:13 ` [PATCH 3/8] parisc: turn GET_IOC into an inline function 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=20190114112353.30616-4-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).