Skip to content

Commit

Permalink
parisc: turn GET_IOC into an inline function
Browse files Browse the repository at this point in the history
This makes the function both more readable and more typesafe.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
  • Loading branch information
Christoph Hellwig authored and hdeller committed Feb 21, 2019
1 parent 9b8eeab commit 25c9dbe
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/parisc/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 25c9dbe

Please sign in to comment.