MSI: Consolidate precondition checks
authorMichael Ellerman <michael@ellerman.id.au>
Thu, 22 Mar 2007 10:51:39 +0000 (21:51 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 May 2007 02:02:36 +0000 (19:02 -0700)
Consolidate precondition checks into a single if statement.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/msi.c

index d5b9b94a2ac5e497830dc1348c22119a950e1704..b6dc69ef80a750e1af22f5ed654f78db259dfaa9 100644 (file)
@@ -525,12 +525,7 @@ void pci_disable_msi(struct pci_dev* dev)
        struct msi_desc *entry;
        int default_irq;
 
-       if (!pci_msi_enable)
-               return;
-       if (!dev)
-               return;
-
-       if (!dev->msi_enabled)
+       if (!pci_msi_enable || !dev || !dev->msi_enabled)
                return;
 
        msi_set_enable(dev, 0);
@@ -656,12 +651,7 @@ static void msix_free_all_irqs(struct pci_dev *dev)
 
 void pci_disable_msix(struct pci_dev* dev)
 {
-       if (!pci_msi_enable)
-               return;
-       if (!dev)
-               return;
-
-       if (!dev->msix_enabled)
+       if (!pci_msi_enable || !dev || !dev->msix_enabled)
                return;
 
        msix_set_enable(dev, 0);