Commit 205e550a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

task_work: minor cleanups

Trivial.  Remove the unnecessary "work = NULL" initialization and turn
read_barrier_depends() into smp_read_barrier_depends() in
task_work_cancel().
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 202da400
...@@ -25,7 +25,7 @@ struct callback_head * ...@@ -25,7 +25,7 @@ struct callback_head *
task_work_cancel(struct task_struct *task, task_work_func_t func) task_work_cancel(struct task_struct *task, task_work_func_t func)
{ {
struct callback_head **pprev = &task->task_works; struct callback_head **pprev = &task->task_works;
struct callback_head *work = NULL; struct callback_head *work;
unsigned long flags; unsigned long flags;
/* /*
* If cmpxchg() fails we continue without updating pprev. * If cmpxchg() fails we continue without updating pprev.
...@@ -35,7 +35,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func) ...@@ -35,7 +35,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func)
*/ */
raw_spin_lock_irqsave(&task->pi_lock, flags); raw_spin_lock_irqsave(&task->pi_lock, flags);
while ((work = ACCESS_ONCE(*pprev))) { while ((work = ACCESS_ONCE(*pprev))) {
read_barrier_depends(); smp_read_barrier_depends();
if (work->func != func) if (work->func != func)
pprev = &work->next; pprev = &work->next;
else if (cmpxchg(pprev, work, work->next) == work) else if (cmpxchg(pprev, work, work->next) == work)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment