|
@@ -295,8 +295,7 @@ static void iommu_release_one(u32 busa, int npages, struct sbus_bus *sbus)
|
|
int ioptex;
|
|
int ioptex;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- if (busa < iommu->start)
|
|
|
|
- BUG();
|
|
|
|
|
|
+ BUG_ON(busa < iommu->start);
|
|
ioptex = (busa - iommu->start) >> PAGE_SHIFT;
|
|
ioptex = (busa - iommu->start) >> PAGE_SHIFT;
|
|
for (i = 0; i < npages; i++) {
|
|
for (i = 0; i < npages; i++) {
|
|
iopte_val(iommu->page_table[ioptex + i]) = 0;
|
|
iopte_val(iommu->page_table[ioptex + i]) = 0;
|
|
@@ -340,9 +339,9 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va,
|
|
iopte_t *first;
|
|
iopte_t *first;
|
|
int ioptex;
|
|
int ioptex;
|
|
|
|
|
|
- if ((va & ~PAGE_MASK) != 0) BUG();
|
|
|
|
- if ((addr & ~PAGE_MASK) != 0) BUG();
|
|
|
|
- if ((len & ~PAGE_MASK) != 0) BUG();
|
|
|
|
|
|
+ BUG_ON((va & ~PAGE_MASK) != 0);
|
|
|
|
+ BUG_ON((addr & ~PAGE_MASK) != 0);
|
|
|
|
+ BUG_ON((len & ~PAGE_MASK) != 0);
|
|
|
|
|
|
/* page color = physical address */
|
|
/* page color = physical address */
|
|
ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT,
|
|
ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT,
|
|
@@ -405,8 +404,8 @@ static void iommu_unmap_dma_area(unsigned long busa, int len)
|
|
unsigned long end;
|
|
unsigned long end;
|
|
int ioptex = (busa - iommu->start) >> PAGE_SHIFT;
|
|
int ioptex = (busa - iommu->start) >> PAGE_SHIFT;
|
|
|
|
|
|
- if ((busa & ~PAGE_MASK) != 0) BUG();
|
|
|
|
- if ((len & ~PAGE_MASK) != 0) BUG();
|
|
|
|
|
|
+ BUG_ON((busa & ~PAGE_MASK) != 0);
|
|
|
|
+ BUG_ON((len & ~PAGE_MASK) != 0);
|
|
|
|
|
|
iopte += ioptex;
|
|
iopte += ioptex;
|
|
end = busa + len;
|
|
end = busa + len;
|