summaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-03-22 11:51:39 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-03 04:02:36 +0200
commit128bc5fced238752d01b5169077f2ec624b3d59b (patch)
treefe3317718054dcfdd77139be80a24cb3b5c09833 /drivers/pci/msi.c
parentMSI: Expand pci_msi_supported() (diff)
downloadlinux-128bc5fced238752d01b5169077f2ec624b3d59b.tar.xz
linux-128bc5fced238752d01b5169077f2ec624b3d59b.zip
MSI: Consolidate precondition checks
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>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d5b9b94a2ac5..b6dc69ef80a7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -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);