Skip to content

Commit 192faeb

Browse files
author
Frederic Weisbecker
committed
lib: test_objpool: Use kthread_run_on_cpu()
Use the proper API instead of open coding it. Reviewed-by: Matt Wu <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 294fca6 commit 192faeb

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

lib/test_objpool.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,10 @@ static int ot_start_sync(struct ot_test *test)
371371
if (!cpu_online(cpu))
372372
continue;
373373

374-
work = kthread_create_on_node(ot_thread_worker, item,
375-
cpu_to_node(cpu), "ot_worker_%d", cpu);
376-
if (IS_ERR(work)) {
374+
work = kthread_run_on_cpu(ot_thread_worker, item,
375+
cpu, "ot_worker_%d");
376+
if (IS_ERR(work))
377377
pr_err("failed to create thread for cpu %d\n", cpu);
378-
} else {
379-
kthread_bind(work, cpu);
380-
wake_up_process(work);
381-
}
382378
}
383379

384380
/* wait a while to make sure all threads waiting at start line */
@@ -562,14 +558,9 @@ static int ot_start_async(struct ot_test *test)
562558
if (!cpu_online(cpu))
563559
continue;
564560

565-
work = kthread_create_on_node(ot_thread_worker, item,
566-
cpu_to_node(cpu), "ot_worker_%d", cpu);
567-
if (IS_ERR(work)) {
561+
work = kthread_run_on_cpu(ot_thread_worker, item, cpu, "ot_worker_%d");
562+
if (IS_ERR(work))
568563
pr_err("failed to create thread for cpu %d\n", cpu);
569-
} else {
570-
kthread_bind(work, cpu);
571-
wake_up_process(work);
572-
}
573564
}
574565

575566
/* wait a while to make sure all threads waiting at start line */

0 commit comments

Comments
 (0)