]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: caam - Fix opencoded cpumask_next_wrap() in caam_drv_ctx_init()
authorYury Norov [NVIDIA] <yury.norov@gmail.com>
Wed, 4 Jun 2025 20:47:41 +0000 (16:47 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 13 Jun 2025 09:26:17 +0000 (17:26 +0800)
The dedicated cpumask_next_wrap() is more verbose and better optimized
comparing to cpumask_next() followed by cpumask_first().

Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/qi.c

index b6e7c0b29d4e6c16495bcecd6869e6adf7442199..1e731ed8702b5d55e6f65aa3787a820bd9c3142e 100644 (file)
@@ -442,11 +442,8 @@ struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev,
        if (!cpumask_test_cpu(*cpu, cpus)) {
                int *pcpu = &get_cpu_var(last_cpu);
 
-               *pcpu = cpumask_next(*pcpu, cpus);
-               if (*pcpu >= nr_cpu_ids)
-                       *pcpu = cpumask_first(cpus);
+               *pcpu = cpumask_next_wrap(*pcpu, cpus);
                *cpu = *pcpu;
-
                put_cpu_var(last_cpu);
        }
        drv_ctx->cpu = *cpu;