From: Joerg Roedel Date: Thu, 13 Aug 2015 09:15:13 +0000 (+0200) Subject: iommu/amd: Use BUG_ON instead of if () BUG() X-Git-Tag: v4.14-rc1~4724^2^7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23d3a98c13ee0ffe2647121fac7533282643e6f1;p=platform%2Fkernel%2Flinux-rpi.git iommu/amd: Use BUG_ON instead of if () BUG() Found by a coccicheck script. Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a1585796..f82060e7 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -1835,8 +1835,8 @@ static void free_gcr3_table(struct protection_domain *domain) free_gcr3_tbl_level2(domain->gcr3_tbl); else if (domain->glx == 1) free_gcr3_tbl_level1(domain->gcr3_tbl); - else if (domain->glx != 0) - BUG(); + else + BUG_ON(domain->glx != 0); free_page((unsigned long)domain->gcr3_tbl); } diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index f7b875b..1131664 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c @@ -356,8 +356,8 @@ static void free_pasid_states(struct device_state *dev_state) free_pasid_states_level2(dev_state->states); else if (dev_state->pasid_levels == 1) free_pasid_states_level1(dev_state->states); - else if (dev_state->pasid_levels != 0) - BUG(); + else + BUG_ON(dev_state->pasid_levels != 0); free_page((unsigned long)dev_state->states); }