iommu/amd: Use BUG_ON instead of if () BUG()
authorJoerg Roedel <jroedel@suse.de>
Thu, 13 Aug 2015 09:15:13 +0000 (11:15 +0200)
committerJoerg Roedel <jroedel@suse.de>
Thu, 13 Aug 2015 17:49:14 +0000 (19:49 +0200)
Found by a coccicheck script.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c
drivers/iommu/amd_iommu_v2.c

index a158579..f82060e 100644 (file)
@@ -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);
 }
Simple merge