diff options
author | chenqiwu <chenqiwu@xiaomi.com> | 2020-02-14 10:16:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-03 03:06:44 +0200 |
commit | 6a0033457f2380852a3a4138d4c79571a5b51be6 (patch) | |
tree | a55e1812af4c9ac9bc822050168480d5546baf73 /drivers/ide/ide-scan-pci.c | |
parent | Merge tag 'devicetree-for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-6a0033457f2380852a3a4138d4c79571a5b51be6.tar.xz linux-6a0033457f2380852a3a4138d4c79571a5b51be6.zip |
drivers/ide: convert to list_for_each_entry_safe()
Use list_for_each_entry_safe() instead of list_for_each_safe()
to simplify the code.
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide/ide-scan-pci.c')
-rw-r--r-- | drivers/ide/ide-scan-pci.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/ide/ide-scan-pci.c b/drivers/ide/ide-scan-pci.c index acf874800ca4..383f0d813001 100644 --- a/drivers/ide/ide-scan-pci.c +++ b/drivers/ide/ide-scan-pci.c @@ -89,8 +89,7 @@ static int __init ide_scan_pcidev(struct pci_dev *dev) static int __init ide_scan_pcibus(void) { struct pci_dev *dev = NULL; - struct pci_driver *d; - struct list_head *l, *n; + struct pci_driver *d, *tmp; pre_init = 0; for_each_pci_dev(dev) @@ -101,9 +100,8 @@ static int __init ide_scan_pcibus(void) * are post init. */ - list_for_each_safe(l, n, &ide_pci_drivers) { - list_del(l); - d = list_entry(l, struct pci_driver, node); + list_for_each_entry_safe(d, tmp, &ide_pci_drivers, node) { + list_del(d->node); if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name)) printk(KERN_ERR "%s: failed to register %s driver\n", |