diff mbox series

[-next,v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu()

Message ID 20240904022633.2079803-1-lihongbo22@huawei.com (mailing list archive)
State New
Delegated to: Christophe Leroy
Headers show
Series [-next,v2] soc/fsl/qbman: make use of the helper function kthread_run_on_cpu() | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 21 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 5 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.

Commit Message

Hongbo Li Sept. 4, 2024, 2:26 a.m. UTC
Replace kthread_create/kthread_bind/wake_up_process() with
kthread_run_on_cpu() to simplify the code.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>

---
v2:
  - Remove the extra parameter to solve the compilation.
  - Change cpu from int type to unsigned int type.

v1: https://lore.kernel.org/linux-arm-kernel/20240902133125.3089560-1-lihongbo22@huawei.com/T/
---
 drivers/soc/fsl/qbman/qman_test_stash.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c
index b7e8e5ec884c..639acaf6ce18 100644
--- a/drivers/soc/fsl/qbman/qman_test_stash.c
+++ b/drivers/soc/fsl/qbman/qman_test_stash.c
@@ -101,21 +101,19 @@  static int bstrap_fn(void *bs)
 }
 static int on_all_cpus(int (*fn)(void))
 {
-	int cpu;
+	unsigned int cpu;
 
 	for_each_cpu(cpu, cpu_online_mask) {
 		struct bstrap bstrap = {
 			.fn = fn,
 			.started = ATOMIC_INIT(0)
 		};
-		struct task_struct *k = kthread_create(bstrap_fn, &bstrap,
-			"hotpotato%d", cpu);
+		struct task_struct *k = kthread_run_on_cpu(bstrap_fn, &bstrap,
+						cpu, "hotpotato%u");
 		int ret;
 
 		if (IS_ERR(k))
 			return -ENOMEM;
-		kthread_bind(k, cpu);
-		wake_up_process(k);
 		/*
 		 * If we call kthread_stop() before the "wake up" has had an
 		 * effect, then the thread may exit with -EINTR without ever