Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Ellerman and committed by
Greg Kroah-Hartman
128bc5fc b1e2303d

+2 -12
+2 -12
drivers/pci/msi.c
··· 525 525 struct msi_desc *entry; 526 526 int default_irq; 527 527 528 - if (!pci_msi_enable) 529 - return; 530 - if (!dev) 531 - return; 532 - 533 - if (!dev->msi_enabled) 528 + if (!pci_msi_enable || !dev || !dev->msi_enabled) 534 529 return; 535 530 536 531 msi_set_enable(dev, 0); ··· 651 656 652 657 void pci_disable_msix(struct pci_dev* dev) 653 658 { 654 - if (!pci_msi_enable) 655 - return; 656 - if (!dev) 657 - return; 658 - 659 - if (!dev->msix_enabled) 659 + if (!pci_msi_enable || !dev || !dev->msix_enabled) 660 660 return; 661 661 662 662 msix_set_enable(dev, 0);