summaryrefslogtreecommitdiff
path: root/drivers/parisc/iommu.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-01-29 19:13:05 +0100
committerHelge Deller <deller@gmx.de>2019-02-21 20:37:12 +0100
commit25c9dbe8bb105d6eea3e3117344181970a6b9366 (patch)
treebf18410b0dbf8854e15e1394eea3e0fa1bf74f8f /drivers/parisc/iommu.h
parent9b8eeab019762fa43c5ffa6e2f8e1039f8e99157 (diff)
downloadlwn-25c9dbe8bb105d6eea3e3117344181970a6b9366.tar.gz
lwn-25c9dbe8bb105d6eea3e3117344181970a6b9366.zip
parisc: turn GET_IOC into an inline function
This makes the function both more readable and more typesafe. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/parisc/iommu.h')
-rw-r--r--drivers/parisc/iommu.h12
1 files 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);