Skip to content

Commit

Permalink
MSI: Consolidate precondition checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman authored and Greg Kroah-Hartman committed May 3, 2007
1 parent b1e2303 commit 128bc5f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 128bc5f

Please sign in to comment.