All kthread worker users now create their workers with kthread_create_worker*(), which sets worker->task before the worker starts. The self assignment in kthread_worker_fn() is dead code now. Remove the assignment but keep the WARN_ON() as a sanity check for any OOT users still using the old API. Suggested-by: Frederic Weisbecker Signed-off-by: Bradley Morgan --- kernel/kthread.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/kthread.c b/kernel/kthread.c index 63beb59b7a3d..643407647e79 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -987,12 +987,10 @@ int kthread_worker_fn(void *worker_ptr) struct kthread_worker *worker = worker_ptr; struct kthread_work *work; - /* - * FIXME: Update the check and remove the assignment when all kthread - * worker users are created using kthread_create_worker*() functions. + /* All workers are created with worker->task set. If this fires, + * the caller is broken. */ - WARN_ON(worker->task && worker->task != current); - worker->task = current; + WARN_ON(worker->task != current); if (worker->flags & KTW_FREEZABLE) set_freezable(); -- 2.47.3