aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/async.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/async.c b/kernel/async.c
index 50540301ed0f..27235f5de198 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -92,23 +92,18 @@ extern int initcall_debug;
92static async_cookie_t __lowest_in_progress(struct list_head *running) 92static async_cookie_t __lowest_in_progress(struct list_head *running)
93{ 93{
94 struct async_entry *entry; 94 struct async_entry *entry;
95 async_cookie_t ret = next_cookie; /* begin with "infinity" value */
96 95
97 if (!list_empty(running)) { 96 if (!list_empty(running)) {
98 entry = list_first_entry(running, 97 entry = list_first_entry(running,
99 struct async_entry, list); 98 struct async_entry, list);
100 ret = entry->cookie; 99 return entry->cookie;
101 } 100 }
102 101
103 if (!list_empty(&async_pending)) { 102 list_for_each_entry(entry, &async_pending, list)
104 list_for_each_entry(entry, &async_pending, list) 103 if (entry->running == running)
105 if (entry->running == running) { 104 return entry->cookie;
106 ret = entry->cookie;
107 break;
108 }
109 }
110 105
111 return ret; 106 return next_cookie; /* "infinity" value */
112} 107}
113 108
114static async_cookie_t lowest_in_progress(struct list_head *running) 109static async_cookie_t lowest_in_progress(struct list_head *running)