diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-08-13 05:15:13 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-08-13 13:49:14 -0400 |
commit | 23d3a98c13ee0ffe2647121fac7533282643e6f1 (patch) | |
tree | f9e629c69b1c8821899479b42b1036ef826c3eb1 /drivers/iommu | |
parent | 4160cd9e5ef9ac9f1c9c429e1606bf08a56c8a49 (diff) |
iommu/amd: Use BUG_ON instead of if () BUG()
Found by a coccicheck script.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 4 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a1585796785b..f82060e778a2 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) | |||
1835 | free_gcr3_tbl_level2(domain->gcr3_tbl); | 1835 | free_gcr3_tbl_level2(domain->gcr3_tbl); |
1836 | else if (domain->glx == 1) | 1836 | else if (domain->glx == 1) |
1837 | free_gcr3_tbl_level1(domain->gcr3_tbl); | 1837 | free_gcr3_tbl_level1(domain->gcr3_tbl); |
1838 | else if (domain->glx != 0) | 1838 | else |
1839 | BUG(); | 1839 | BUG_ON(domain->glx != 0); |
1840 | 1840 | ||
1841 | free_page((unsigned long)domain->gcr3_tbl); | 1841 | free_page((unsigned long)domain->gcr3_tbl); |
1842 | } | 1842 | } |
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index f7b875bb70d4..1131664b918b 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) | |||
356 | free_pasid_states_level2(dev_state->states); | 356 | free_pasid_states_level2(dev_state->states); |
357 | else if (dev_state->pasid_levels == 1) | 357 | else if (dev_state->pasid_levels == 1) |
358 | free_pasid_states_level1(dev_state->states); | 358 | free_pasid_states_level1(dev_state->states); |
359 | else if (dev_state->pasid_levels != 0) | 359 | else |
360 | BUG(); | 360 | BUG_ON(dev_state->pasid_levels != 0); |
361 | 361 | ||
362 | free_page((unsigned long)dev_state->states); | 362 | free_page((unsigned long)dev_state->states); |
363 | } | 363 | } |