From 25c9dbe8bb105d6eea3e3117344181970a6b9366 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 29 Jan 2019 19:13:05 +0100 Subject: [PATCH] parisc: turn GET_IOC into an inline function This makes the function both more readable and more typesafe. Signed-off-by: Christoph Hellwig Signed-off-by: Helge Deller --- 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 5a38b63..d6fd3ab 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); -- 2.7.4