[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 <[email protected]>
Cc: Ram Pai <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Akinobu Mita 2006-06-26 00:24:40 -07:00 • committed by Linus Torvalds
commit 1bfba4e8ea
8 changed files with 22 additions and 38 deletions

View file

@ -430,10 +430,9 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
i++;
/* fallthrough */
default:
if (filp->f_pos == 2) {
list_del(q);
list_add(q, &parent_sd->s_children);
}
if (filp->f_pos == 2)
list_move(q, &parent_sd->s_children);
for (p=q->next; p!= &parent_sd->s_children; p=p->next) {
struct sysfs_dirent *next;
const char * name;
@ -455,8 +454,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
dt_type(next)) < 0)
return 0;
list_del(q);
list_add(q, p);
list_move(q, p);
p = q;
filp->f_pos++;
}