Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper
@ 2022-09-16 14:03 Yang Yingliang
  2022-09-16 15:12 ` Logan Gunthorpe
  2022-09-19 18:45 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-09-16 14:03 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, logang, hch, yangyingliang

Use for_each_pci_dev() instead of open-coding it.
No functional change.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/pci/p2pdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 4496a7c5c478..88dc66ee1c46 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -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;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper
  2022-09-16 14:03 [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper Yang Yingliang
@ 2022-09-16 15:12 ` Logan Gunthorpe
  2022-09-19 18:45 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Logan Gunthorpe @ 2022-09-16 15:12 UTC (permalink / raw)
  To: Yang Yingliang, linux-pci; +Cc: bhelgaas, hch



On 2022-09-16 08:03, Yang Yingliang wrote:
> Use for_each_pci_dev() instead of open-coding it.
> No functional change.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>

Thanks!

Logan

> ---
>  drivers/pci/p2pdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index 4496a7c5c478..88dc66ee1c46 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -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;
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper
  2022-09-16 14:03 [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper Yang Yingliang
  2022-09-16 15:12 ` Logan Gunthorpe
@ 2022-09-19 18:45 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2022-09-19 18:45 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-pci, bhelgaas, logang, hch

On Fri, Sep 16, 2022 at 10:03:29PM +0800, Yang Yingliang wrote:
> Use for_each_pci_dev() instead of open-coding it.
> No functional change.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Applied with Logan's Reviewed-by to pci/misc for v6.1, thanks!

> ---
>  drivers/pci/p2pdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index 4496a7c5c478..88dc66ee1c46 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -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;
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-19 18:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-16 14:03 [PATCH -next] PCI/P2PDMA: Switch to use for_each_pci_dev() helper Yang Yingliang
2022-09-16 15:12 ` Logan Gunthorpe
2022-09-19 18:45 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox