[patch V2 14/23] PCI/MSI: Make msix_update_entries() smarter

Thomas Gleixner tglx at linutronix.de
Tue Dec 7 09:27:46 AEDT 2021


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 at linutronix.de>
Tested-by: Juergen Gross <jgross at suse.com>
Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>
---
 drivers/pci/msi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -642,8 +642,8 @@ static void msix_update_entries(struct p
 {
 	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++;
 		}



More information about the Linuxppc-dev mailing list