aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/sba_iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parisc/sba_iommu.c')
-rw-r--r--drivers/parisc/sba_iommu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 322957ac2ad1..d044c48323e6 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -113,8 +113,6 @@ module_param(sba_reserve_agpgart, int, 0444);
113MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART"); 113MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART");
114#endif 114#endif
115 115
116#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1))
117
118 116
119/************************************ 117/************************************
120** SBA register read and write support 118** SBA register read and write support
@@ -352,7 +350,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
352 ** SBA HW features in the unmap path. 350 ** SBA HW features in the unmap path.
353 */ 351 */
354 unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT); 352 unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT);
355 uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o); 353 uint bitshiftcnt = ALIGN(ioc->res_bitshift, o);
356 unsigned long mask; 354 unsigned long mask;
357 355
358 if (bitshiftcnt >= BITS_PER_LONG) { 356 if (bitshiftcnt >= BITS_PER_LONG) {
@@ -779,7 +777,7 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
779 offset = iova & ~IOVP_MASK; 777 offset = iova & ~IOVP_MASK;
780 iova ^= offset; /* clear offset bits */ 778 iova ^= offset; /* clear offset bits */
781 size += offset; 779 size += offset;
782 size = ROUNDUP(size, IOVP_SIZE); 780 size = ALIGN(size, IOVP_SIZE);
783 781
784 spin_lock_irqsave(&ioc->res_lock, flags); 782 spin_lock_irqsave(&ioc->res_lock, flags);
785 783