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

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

+2 -2
+2 -2
drivers/pci/msi.c
··· 642 642 { 643 643 struct msi_desc *entry; 644 644 645 - for_each_pci_msi_entry(entry, dev) { 646 - if (entries) { 645 + if (entries) { 646 + for_each_pci_msi_entry(entry, dev) { 647 647 entries->vector = entry->irq; 648 648 entries++; 649 649 }