瀏覽代碼

iommu/vt-d: Use BUG_ON instead of if () BUG()

Found by a coccicheck script.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Joerg Roedel 10 年之前
父節點
當前提交
dc02e46e8d
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/iommu/intel-iommu.c

+ 1 - 2
drivers/iommu/intel-iommu.c

@@ -4760,8 +4760,7 @@ static size_t intel_iommu_unmap(struct iommu_domain *domain,
 
 	/* Cope with horrid API which requires us to unmap more than the
 	   size argument if it happens to be a large-page mapping. */
-	if (!pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level))
-		BUG();
+	BUG_ON(!pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level));
 
 	if (size < VTD_PAGE_SIZE << level_to_offset_bits(level))
 		size = VTD_PAGE_SIZE << level_to_offset_bits(level);