From: Christoph Hellwig Date: Tue, 29 Jan 2019 18:13:05 +0000 (+0100) Subject: parisc: turn GET_IOC into an inline function X-Git-Tag: v5.4-rc1~1537^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25c9dbe8bb105d6eea3e3117344181970a6b9366;p=platform%2Fkernel%2Flinux-rpi.git 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 --- 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);