summaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_pci_sysfs.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-12-04 00:01:42 -0500
committerBorislav Petkov <bp@alien8.de>2012-12-04 08:27:39 +0100
commit3bfe5aae8edd8436d26cddfeab783492d8950821 (patch)
tree1efcdf3b2194fbaf6af30543e581277af4c94bc3 /drivers/edac/edac_pci_sysfs.c
parent2d56b109e3a50cf316e60f07541bbeb1d8fe251a (diff)
downloadlinux-stable-3bfe5aae8edd8436d26cddfeab783492d8950821.tar.gz
linux-stable-3bfe5aae8edd8436d26cddfeab783492d8950821.tar.bz2
linux-stable-3bfe5aae8edd8436d26cddfeab783492d8950821.zip
EDAC, pci_sysfs: Use for_each_pci_dev to simplify the code
Use for_each_pci_dev to simplify the code. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> [Boris: cleanup comments and drop loop brackets] Signed-off-by: Borislav Petkov <bp@alien8.de>
Diffstat (limited to 'drivers/edac/edac_pci_sysfs.c')
-rw-r--r--drivers/edac/edac_pci_sysfs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index e164c555a337..dc6e905ee1a5 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -645,20 +645,16 @@ typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev);
/*
* pci_dev parity list iterator
- * Scan the PCI device list for one pass, looking for SERRORs
- * Master Parity ERRORS or Parity ERRORs on primary or secondary devices
+ *
+ * Scan the PCI device list looking for SERRORs, Master Parity ERRORS or
+ * Parity ERRORs on primary or secondary devices.
*/
static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn)
{
struct pci_dev *dev = NULL;
- /* request for kernel access to the next PCI device, if any,
- * and while we are looking at it have its reference count
- * bumped until we are done with it
- */
- while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ for_each_pci_dev(dev)
fn(dev);
- }
}
/*