diff options
| author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-06-08 19:27:13 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-06-08 19:27:13 +0100 |
| commit | 7698fdedcfa3cab3dd40c9b685590b23be02e267 (patch) | |
| tree | 207ddae0f963174356b1a9de7fff8e48a9c1e9c1 /kernel/async.c | |
| parent | 2d8d24935d372175786ebefa8a2de8680831b67f (diff) | |
| parent | ae5c8c83735f5fcb09b380944e4854a383006998 (diff) | |
Merge branch 'for-rmk' of git://git.marvell.com/orion into devel
Diffstat (limited to 'kernel/async.c')
| -rw-r--r-- | kernel/async.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/async.c b/kernel/async.c index 968ef9457d4..50540301ed0 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -92,19 +92,23 @@ extern int initcall_debug; static async_cookie_t __lowest_in_progress(struct list_head *running) { struct async_entry *entry; + async_cookie_t ret = next_cookie; /* begin with "infinity" value */ + if (!list_empty(running)) { entry = list_first_entry(running, struct async_entry, list); - return entry->cookie; - } else if (!list_empty(&async_pending)) { - entry = list_first_entry(&async_pending, - struct async_entry, list); - return entry->cookie; - } else { - /* nothing in progress... next_cookie is "infinity" */ - return next_cookie; + ret = entry->cookie; } + if (!list_empty(&async_pending)) { + list_for_each_entry(entry, &async_pending, list) + if (entry->running == running) { + ret = entry->cookie; + break; + } + } + + return ret; } static async_cookie_t lowest_in_progress(struct list_head *running) |
