Skip to content

Commit 25c9dbe

Browse files
Christoph Hellwighdeller
authored andcommitted
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>
1 parent 9b8eeab commit 25c9dbe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/parisc/iommu.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ static inline void *parisc_walk_tree(struct device *dev)
2626
return dev->platform_data;
2727
}
2828

29-
#define GET_IOC(dev) ({ \
30-
void *__pdata = parisc_walk_tree(dev); \
31-
__pdata ? HBA_DATA(__pdata)->iommu : NULL; \
32-
})
29+
static inline struct ioc *GET_IOC(struct device *dev)
30+
{
31+
struct pci_hba_data *pdata = parisc_walk_tree(dev);
32+
33+
if (!pdata)
34+
return NULL;
35+
return pdata->iommu;
36+
}
3337

3438
#ifdef CONFIG_IOMMU_CCIO
3539
void *ccio_get_iommu(const struct parisc_device *dev);

0 commit comments

Comments
 (0)