summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-12-07 01:27:46 +0300
committerThomas Gleixner <tglx@linutronix.de>2021-12-09 13:52:21 +0300
commit7112158d97a1539b217c360d379724ac3ee99fa3 (patch)
treee676074b091067c7fb5e4140a0a0f32f9a1ebd47
parent29a03ada4a007067d5427a6a1b7ba1dc7566ea2e (diff)
downloadlinux-7112158d97a1539b217c360d379724ac3ee99fa3.tar.xz
PCI/MSI: Make msix_update_entries() smarter
No need to walk the descriptors and check for each one whether the entries pointer function argument is NULL. Do it once. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20211206210224.600351129@linutronix.de
-rw-r--r--drivers/pci/msi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a76fcf4b2bde..15730910b3cb 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -642,8 +642,8 @@ static void msix_update_entries(struct pci_dev *dev, struct msix_entry *entries)
{
struct msi_desc *entry;
- for_each_pci_msi_entry(entry, dev) {
- if (entries) {
+ if (entries) {
+ for_each_pci_msi_entry(entry, dev) {
entries->vector = entry->irq;
entries++;
}