Patchwork [-next] net: neterion: use for_each_pci_dev to simplify the code

login
register
mail settings
Submitter Wei Yongjun
Date Dec. 4, 2012, 5:05 a.m.
Message ID <CAPgLHd-W5Lpa7EPFMit6Go+zt6ZrsV9dhEg9B2eQDxFCzau0Zg@mail.gmail.com>
Download mbox | patch
Permalink /patch/203556/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - Dec. 4, 2012, 5:05 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Use for_each_pci_dev to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/neterion/s2io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 4, 2012, 6:20 p.m.
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Tue, 4 Dec 2012 00:05:13 -0500

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Use for_each_pci_dev to simplify the code.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index c98decb..3b63504 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -1040,7 +1040,7 @@  static int s2io_verify_pci_mode(struct s2io_nic *nic)
 static int s2io_on_nec_bridge(struct pci_dev *s2io_pdev)
 {
 	struct pci_dev *tdev = NULL;
-	while ((tdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, tdev)) != NULL) {
+	for_each_pci_dev(tdev) {
 		if (tdev->vendor == NEC_VENID && tdev->device == NEC_DEVID) {
 			if (tdev->bus == s2io_pdev->bus->parent) {
 				pci_dev_put(tdev);