From: Wei Yongjun Date: Tue, 4 Dec 2012 05:01:42 +0000 (-0500) Subject: EDAC, pci_sysfs: Use for_each_pci_dev to simplify the code X-Git-Tag: accepted/tizen/common/20141203.182822~3289^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bfe5aae8edd8436d26cddfeab783492d8950821;p=platform%2Fkernel%2Flinux-arm64.git 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 [Boris: cleanup comments and drop loop brackets] Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index e164c55..dc6e905 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); - } } /*