]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scftorture: Avoid additional div operation.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 8 Nov 2024 10:39:31 +0000 (11:39 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 9 Nov 2024 17:00:46 +0000 (09:00 -0800)
Replace "scfp->cpu % nr_cpu_ids" with "cpu". This has been computed
earlier.

Tested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Tested-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/scftorture.c

index 44e83a6462647851ca3c100397d424dfa7ff5084..455cbff35a1a258e0171c0e6853de3a861f02c97 100644 (file)
@@ -463,7 +463,7 @@ static int scftorture_invoker(void *arg)
 
        // Make sure that the CPU is affinitized appropriately during testing.
        curcpu = raw_smp_processor_id();
-       WARN_ONCE(curcpu != scfp->cpu % nr_cpu_ids,
+       WARN_ONCE(curcpu != cpu,
                  "%s: Wanted CPU %d, running on %d, nr_cpu_ids = %d\n",
                  __func__, scfp->cpu, curcpu, nr_cpu_ids);