diff mbox

[4/4] PCI: ats: Use BUG_ON()

Message ID 1439487436-26989-4-git-send-email-fabio.estevam@freescale.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Fabio Estevam Aug. 13, 2015, 5:37 p.m. UTC
Use BUG_ON() instead of an if condition followed by BUG().

The semantic patch that makes this change is available
in scripts/coccinelle/misc/bugon.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/pci/ats.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index a8099d4..1c25b20 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -134,8 +134,7 @@  void pci_restore_ats_state(struct pci_dev *dev)
 
 	if (!pci_ats_enabled(dev))
 		return;
-	if (!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ATS))
-		BUG();
+	BUG_ON(!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ATS));
 
 	ctrl = PCI_ATS_CTRL_ENABLE;
 	if (!dev->is_virtfn)