]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
parisc: turn GET_IOC into an inline function
authorChristoph Hellwig <hch@lst.de>
Tue, 29 Jan 2019 18:13:05 +0000 (19:13 +0100)
committerHelge Deller <deller@gmx.de>
Thu, 21 Feb 2019 19:37:12 +0000 (20:37 +0100)
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>
drivers/parisc/iommu.h

index 5a38b635e963167dfe465f9bdb58bcb476827165..d6fd3ab899acf34765dbcec61629c09d6d03e9e9 100644 (file)
@@ -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);