Skip to content

Commit

Permalink
EDAC, pci_sysfs: Use for_each_pci_dev to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Borislav Petkov committed Dec 4, 2012
1 parent 2d56b10 commit 3bfe5aa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/edac/edac_pci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/*
Expand Down

0 comments on commit 3bfe5aa

Please sign in to comment.