Skip to content

Commit

Permalink
iommu/amd: Use BUG_ON instead of if () BUG()
Browse files Browse the repository at this point in the history
Found by a coccicheck script.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Aug 13, 2015
1 parent 4160cd9 commit 23d3a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/iommu/amd_iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 23d3a98

Please sign in to comment.