mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 19/19] drivers/usb/core: use for_each_pci_dev()
@ 2010-07-03 16:04 Kulikov Vasiliy
  2010-07-04 13:18 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Kulikov Vasiliy @ 2010-07-03 16:04 UTC (permalink / raw)
  To: Kernel Janitors
  Cc: Greg Kroah-Hartman, Alan Stern, Andrew Morton, Alexey Dobriyan,
	Rafael J. Wysocki, linux-usb, linux-kernel

Use for_each_pci_dev() to simplify the code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/usb/core/hcd-pci.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 7e2d527..c1f0bba 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -66,10 +66,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd,
 	 * vice versa.
 	 */
 	companion = NULL;
-	for (;;) {
-		companion = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, companion);
-		if (!companion)
-			break;
+	for_each_pci_dev(companion) {
 		if (companion->bus != pdev->bus ||
 				PCI_SLOT(companion->devfn) != slot)
 			continue;
-- 
1.7.0.4


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

* Re: [PATCH 19/19] drivers/usb/core: use for_each_pci_dev()
  2010-07-03 16:04 [PATCH 19/19] drivers/usb/core: use for_each_pci_dev() Kulikov Vasiliy
@ 2010-07-04 13:18 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2010-07-04 13:18 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: Kernel Janitors, Greg Kroah-Hartman, Andrew Morton,
	Alexey Dobriyan, Rafael J. Wysocki, linux-usb, linux-kernel

On Sat, 3 Jul 2010, Kulikov Vasiliy wrote:

> Use for_each_pci_dev() to simplify the code.
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  drivers/usb/core/hcd-pci.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
> index 7e2d527..c1f0bba 100644
> --- a/drivers/usb/core/hcd-pci.c
> +++ b/drivers/usb/core/hcd-pci.c
> @@ -66,10 +66,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd,
>  	 * vice versa.
>  	 */
>  	companion = NULL;
> -	for (;;) {
> -		companion = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, companion);
> -		if (!companion)
> -			break;
> +	for_each_pci_dev(companion) {
>  		if (companion->bus != pdev->bus ||
>  				PCI_SLOT(companion->devfn) != slot)
>  			continue;

Acked-by: Alan Stern <stern@rowland.harvard.edu>


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

end of thread, other threads:[~2010-07-04 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-03 16:04 [PATCH 19/19] drivers/usb/core: use for_each_pci_dev() Kulikov Vasiliy
2010-07-04 13:18 ` Alan Stern

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

all inboxes | Powered by JetHome®