Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757673Ab0GDNSq (ORCPT ); Sun, 4 Jul 2010 09:18:46 -0400 Received: from netrider.rowland.org ([192.131.102.5]:43477 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757565Ab0GDNSg (ORCPT ); Sun, 4 Jul 2010 09:18:36 -0400 Date: Sun, 4 Jul 2010 09:18:34 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Kulikov Vasiliy cc: Kernel Janitors , Greg Kroah-Hartman , Andrew Morton , Alexey Dobriyan , "Rafael J. Wysocki" , , Subject: Re: [PATCH 19/19] drivers/usb/core: use for_each_pci_dev() In-Reply-To: <1278173088-12051-1-git-send-email-segooon@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1112 Lines: 33 On Sat, 3 Jul 2010, Kulikov Vasiliy wrote: > Use for_each_pci_dev() to simplify the code. > > Signed-off-by: Kulikov Vasiliy > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/