diff options
author | Fabio Estevam <festevam@gmail.com> | 2018-02-26 21:54:02 -0300 |
---|---|---|
committer | Fabio Estevam <festevam@gmail.com> | 2018-02-26 21:54:02 -0300 |
commit | 20ebb9fb81ecf84b57197aaa2a44be017d48e597 (patch) | |
tree | 54f6e35248e45254412291842083ddde9e400867 /kernel/async.c | |
parent | 3c939d6f1d4c5c70b26d23cbd2e3d3e67e2bca69 (diff) | |
parent | 19c04ca5b239e6e2277a5b381d1e79482ab9bbc5 (diff) |
Merge tag 'v4.9.84' into 4.9-1.0.x-imx-stable-merge
This is the 4.9.84 stable release
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 d2edd6efec56..d84d4860992e 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -84,20 +84,24 @@ static atomic_t entry_count; static async_cookie_t lowest_in_progress(struct async_domain *domain) { - struct list_head *pending; + struct async_entry *first = NULL; async_cookie_t ret = ASYNC_COOKIE_MAX; unsigned long flags; spin_lock_irqsave(&async_lock, flags); - if (domain) - pending = &domain->pending; - else - pending = &async_global_pending; + if (domain) { + if (!list_empty(&domain->pending)) + first = list_first_entry(&domain->pending, + struct async_entry, domain_list); + } else { + if (!list_empty(&async_global_pending)) + first = list_first_entry(&async_global_pending, + struct async_entry, global_list); + } - if (!list_empty(pending)) - ret = list_first_entry(pending, struct async_entry, - domain_list)->cookie; + if (first) + ret = first->cookie; spin_unlock_irqrestore(&async_lock, flags); return ret; |