Skip to content

Commit

Permalink
task_work: minor cleanups
Browse files Browse the repository at this point in the history
Trivial.  Remove the unnecessary "work = NULL" initialization and turn
read_barrier_depends() into smp_read_barrier_depends() in
task_work_cancel().

Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
oleg-nesterov authored and torvalds committed Sep 11, 2013
1 parent 202da40 commit 205e550
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/task_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct callback_head *
task_work_cancel(struct task_struct *task, task_work_func_t func)
{
struct callback_head **pprev = &task->task_works;
struct callback_head *work = NULL;
struct callback_head *work;
unsigned long flags;
/*
* If cmpxchg() fails we continue without updating pprev.
Expand All @@ -35,7 +35,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func)
*/
raw_spin_lock_irqsave(&task->pi_lock, flags);
while ((work = ACCESS_ONCE(*pprev))) {
read_barrier_depends();
smp_read_barrier_depends();
if (work->func != func)
pprev = &work->next;
else if (cmpxchg(pprev, work, work->next) == work)
Expand Down

0 comments on commit 205e550

Please sign in to comment.