[PATCH] core: use list_move()
This patch converts the combination of list_del(A) and list_add(A, B) to list_move(A, B). Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
a7addcea6a
commit
1bfba4e8ea
@@ -116,12 +116,10 @@ int device_suspend(pm_message_t state)
|
||||
/* Check if the device got removed */
|
||||
if (!list_empty(&dev->power.entry)) {
|
||||
/* Move it to the dpm_off or dpm_off_irq list */
|
||||
if (!error) {
|
||||
list_del(&dev->power.entry);
|
||||
list_add(&dev->power.entry, &dpm_off);
|
||||
} else if (error == -EAGAIN) {
|
||||
list_del(&dev->power.entry);
|
||||
list_add(&dev->power.entry, &dpm_off_irq);
|
||||
if (!error)
|
||||
list_move(&dev->power.entry, &dpm_off);
|
||||
else if (error == -EAGAIN) {
|
||||
list_move(&dev->power.entry, &dpm_off_irq);
|
||||
error = 0;
|
||||
}
|
||||
}
|
||||
@@ -139,8 +137,7 @@ int device_suspend(pm_message_t state)
|
||||
*/
|
||||
while (!list_empty(&dpm_off_irq)) {
|
||||
struct list_head * entry = dpm_off_irq.next;
|
||||
list_del(entry);
|
||||
list_add(entry, &dpm_off);
|
||||
list_move(entry, &dpm_off);
|
||||
}
|
||||
dpm_resume();
|
||||
}
|
||||
|
Reference in New Issue
Block a user