diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-06-26 03:24:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:17 -0400 |
commit | 1bfba4e8ea0e555e3a0296051517d96253660ccc (patch) | |
tree | 48ced9016b5c08f1be217677c25e6879c07b5278 /fs/sysfs | |
parent | a7addcea6ac7c0e9733a48cda06ca0880f116a48 (diff) |
[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>
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 610b5bdbe75b..61c42430cba3 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -430,10 +430,9 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | |||
430 | i++; | 430 | i++; |
431 | /* fallthrough */ | 431 | /* fallthrough */ |
432 | default: | 432 | default: |
433 | if (filp->f_pos == 2) { | 433 | if (filp->f_pos == 2) |
434 | list_del(q); | 434 | list_move(q, &parent_sd->s_children); |
435 | list_add(q, &parent_sd->s_children); | 435 | |
436 | } | ||
437 | for (p=q->next; p!= &parent_sd->s_children; p=p->next) { | 436 | for (p=q->next; p!= &parent_sd->s_children; p=p->next) { |
438 | struct sysfs_dirent *next; | 437 | struct sysfs_dirent *next; |
439 | const char * name; | 438 | const char * name; |
@@ -455,8 +454,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | |||
455 | dt_type(next)) < 0) | 454 | dt_type(next)) < 0) |
456 | return 0; | 455 | return 0; |
457 | 456 | ||
458 | list_del(q); | 457 | list_move(q, p); |
459 | list_add(q, p); | ||
460 | p = q; | 458 | p = q; |
461 | filp->f_pos++; | 459 | filp->f_pos++; |
462 | } | 460 | } |