Commit 6a003345 authored by chenqiwu's avatar chenqiwu Committed by David S. Miller

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: default avatarchenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bef7b2a7
...@@ -89,8 +89,7 @@ static int __init ide_scan_pcidev(struct pci_dev *dev) ...@@ -89,8 +89,7 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
static int __init ide_scan_pcibus(void) static int __init ide_scan_pcibus(void)
{ {
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
struct pci_driver *d; struct pci_driver *d, *tmp;
struct list_head *l, *n;
pre_init = 0; pre_init = 0;
for_each_pci_dev(dev) for_each_pci_dev(dev)
...@@ -101,9 +100,8 @@ static int __init ide_scan_pcibus(void) ...@@ -101,9 +100,8 @@ static int __init ide_scan_pcibus(void)
* are post init. * are post init.
*/ */
list_for_each_safe(l, n, &ide_pci_drivers) { list_for_each_entry_safe(d, tmp, &ide_pci_drivers, node) {
list_del(l); list_del(d->node);
d = list_entry(l, struct pci_driver, node);
if (__pci_register_driver(d, d->driver.owner, if (__pci_register_driver(d, d->driver.owner,
d->driver.mod_name)) d->driver.mod_name))
printk(KERN_ERR "%s: failed to register %s driver\n", printk(KERN_ERR "%s: failed to register %s driver\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment