mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bradley Morgan <include@grrlz.net>
To: Frederic Weisbecker <frederic@kernel.org>, Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, brads@mainlining.org
Subject: [PATCH] kthread: remove worker->task self-assignment
Date: Sat, 29 Aug 2026 16:18:48 +0000	[thread overview]
Message-ID: <20260829161848.20635-1-include@grrlz.net> (raw)
In-Reply-To: <20260829161150.16301-1-include@grrlz.net>

From: Bradley Morgan <brads@mainlining.org>

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 it.

Signed-off-by: Bradley Morgan <brads@mainlining.org>
---
 kernel/kthread.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 63beb59b7a3d..18bc702e8d2d 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -987,13 +987,6 @@ 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.
-	 */
-	WARN_ON(worker->task && worker->task != current);
-	worker->task = current;
-
 	if (worker->flags & KTW_FREEZABLE)
 		set_freezable();
 
-- 
2.47.3


  parent reply	other threads:[~2026-08-29 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 16:11 [RESEND PATCH 0/5] " Bradley Morgan
2026-08-29 16:13 ` [PATCH 1/5] media: ivtv: convert to kthread_run_worker Bradley Morgan
2026-08-29 16:15 ` [PATCH 2/5] net: encx24j600: " Bradley Morgan
2026-08-29 16:16 ` [PATCH 3/5] tty: sc16is7xx: " Bradley Morgan
2026-08-29 16:17 ` [PATCH 4/5] cpufreq: schedutil: convert to kthread_create_worker Bradley Morgan
2026-08-29 16:18 ` Bradley Morgan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-29 16:01 [PATCH] kthread: remove worker->task self-assignment Bradley Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260829161848.20635-1-include@grrlz.net \
    --to=include@grrlz.net \
    --cc=brads@mainlining.org \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®