PCI/P2PDMA: Use for_each_pci_dev() helper
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 16 Sep 2022 14:03:29 +0000 (22:03 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 19 Sep 2022 18:44:38 +0000 (13:44 -0500)
Use for_each_pci_dev() instead of open-coding it.  No functional change.

Link: https://lore.kernel.org/r/20220916140329.679633-1-yangyingliang@huawei.com
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
drivers/pci/p2pdma.c

index 4496a7c5c4785377f9ce2487324d2a44091866f5..88dc66ee1c467ea5ec04d317e738cf571aaf3b91 100644 (file)
@@ -649,7 +649,7 @@ struct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients)
        if (!closest_pdevs)
                return NULL;
 
-       while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
+       for_each_pci_dev(pdev) {
                if (!pci_has_p2pmem(pdev))
                        continue;