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
 {
        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++;
                }