Commit c7d7d267 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] increase list_del_init usage.

parent 35a79db4
...@@ -941,8 +941,7 @@ static void usb_hub_events(void) ...@@ -941,8 +941,7 @@ static void usb_hub_events(void)
hub = list_entry(tmp, struct usb_hub, event_list); hub = list_entry(tmp, struct usb_hub, event_list);
dev = interface_to_usbdev(hub->intf); dev = interface_to_usbdev(hub->intf);
list_del(tmp); list_del_init(tmp);
INIT_LIST_HEAD(tmp);
down(&hub->khubd_sem); /* never blocks, we were on list */ down(&hub->khubd_sem); /* never blocks, we were on list */
spin_unlock_irqrestore(&hub_event_lock, flags); spin_unlock_irqrestore(&hub_event_lock, flags);
......
...@@ -755,8 +755,7 @@ void usbfs_remove_device(struct usb_device *dev) ...@@ -755,8 +755,7 @@ void usbfs_remove_device(struct usb_device *dev)
} }
while (!list_empty(&dev->filelist)) { while (!list_empty(&dev->filelist)) {
ds = list_entry(dev->filelist.next, struct dev_state, list); ds = list_entry(dev->filelist.next, struct dev_state, list);
list_del(&ds->list); list_del_init(&ds->list);
INIT_LIST_HEAD(&ds->list);
down_write(&ds->devsem); down_write(&ds->devsem);
ds->dev = NULL; ds->dev = NULL;
up_write(&ds->devsem); up_write(&ds->devsem);
......
...@@ -1207,8 +1207,7 @@ static void hc_release_hci (hci_t * hci) ...@@ -1207,8 +1207,7 @@ static void hc_release_hci (hci_t * hci)
usb_deregister_bus (hci->bus); usb_deregister_bus (hci->bus);
usb_free_bus (hci->bus); usb_free_bus (hci->bus);
list_del (&hci->hci_hcd_list); list_del_init (&hci->hci_hcd_list);
INIT_LIST_HEAD (&hci->hci_hcd_list);
kfree (hci); kfree (hci);
} }
......
...@@ -190,8 +190,7 @@ static inline void insert_dquot_hash(struct dquot *dquot) ...@@ -190,8 +190,7 @@ static inline void insert_dquot_hash(struct dquot *dquot)
static inline void remove_dquot_hash(struct dquot *dquot) static inline void remove_dquot_hash(struct dquot *dquot)
{ {
list_del(&dquot->dq_hash); list_del_init(&dquot->dq_hash);
INIT_LIST_HEAD(&dquot->dq_hash);
} }
static inline struct dquot *find_dquot(unsigned int hashent, struct super_block *sb, unsigned int id, int type) static inline struct dquot *find_dquot(unsigned int hashent, struct super_block *sb, unsigned int id, int type)
...@@ -232,8 +231,7 @@ static inline void remove_free_dquot(struct dquot *dquot) ...@@ -232,8 +231,7 @@ static inline void remove_free_dquot(struct dquot *dquot)
{ {
if (list_empty(&dquot->dq_free)) if (list_empty(&dquot->dq_free))
return; return;
list_del(&dquot->dq_free); list_del_init(&dquot->dq_free);
INIT_LIST_HEAD(&dquot->dq_free);
dqstats.free_dquots--; dqstats.free_dquots--;
} }
...@@ -729,8 +727,7 @@ void put_dquot_list(struct list_head *tofree_head) ...@@ -729,8 +727,7 @@ void put_dquot_list(struct list_head *tofree_head)
while (act_head != tofree_head) { while (act_head != tofree_head) {
dquot = list_entry(act_head, struct dquot, dq_free); dquot = list_entry(act_head, struct dquot, dq_free);
act_head = act_head->next; act_head = act_head->next;
list_del(&dquot->dq_free); /* Remove dquot from the list so we won't have problems... */ list_del_init(&dquot->dq_free); /* Remove dquot from the list so we won't have problems... */
INIT_LIST_HEAD(&dquot->dq_free);
dqput(dquot); dqput(dquot);
} }
unlock_kernel(); unlock_kernel();
......
...@@ -156,8 +156,7 @@ extern rwlock_t dparent_lock; ...@@ -156,8 +156,7 @@ extern rwlock_t dparent_lock;
static __inline__ void d_drop(struct dentry * dentry) static __inline__ void d_drop(struct dentry * dentry)
{ {
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
list_del(&dentry->d_hash); list_del_init(&dentry->d_hash);
INIT_LIST_HEAD(&dentry->d_hash);
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
} }
......
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