diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-06-23 02:05:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 07:43:07 -0700 |
commit | 626ab0e69d376fa07599af669af8ba92d58e87c1 (patch) | |
tree | a995e0231e61fab63568bc7bade81dc20c1dae09 /net/core/dev.c | |
parent | 54e73770357142e297c916c7865f5fca7499f69c (diff) | |
download | blackbird-op-linux-626ab0e69d376fa07599af669af8ba92d58e87c1.tar.gz blackbird-op-linux-626ab0e69d376fa07599af669af8ba92d58e87c1.zip |
[PATCH] list: use list_replace_init() instead of list_splice_init()
list_splice_init(list, head) does unneeded job if it is known that
list_empty(head) == 1. We can use list_replace_init() instead.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ab39fe17cb58..195a5e96b2d1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2980,7 +2980,7 @@ static void netdev_wait_allrefs(struct net_device *dev) static DEFINE_MUTEX(net_todo_run_mutex); void netdev_run_todo(void) { - struct list_head list = LIST_HEAD_INIT(list); + struct list_head list; /* Need to guard against multiple cpu's getting out of order. */ mutex_lock(&net_todo_run_mutex); @@ -2995,9 +2995,9 @@ void netdev_run_todo(void) /* Snapshot list, allow later requests */ spin_lock(&net_todo_list_lock); - list_splice_init(&net_todo_list, &list); + list_replace_init(&net_todo_list, &list); spin_unlock(&net_todo_list_lock); - + while (!list_empty(&list)) { struct net_device *dev = list_entry(list.next, struct net_device, todo_list); |