diff options
author | Yury Norov [NVIDIA] <yury.norov@gmail.com> | 2025-06-04 16:47:41 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-06-13 17:26:17 +0800 |
commit | 4b7ed1ce411e5049b3c842009981c9c5191fea49 (patch) | |
tree | 9b20f553c66b006d783be3856464d7f9668d2d05 | |
parent | ea87e6c40a79de84cc2c6186eafb476be79916e0 (diff) |
crypto: caam - Fix opencoded cpumask_next_wrap() in caam_drv_ctx_init()
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>
-rw-r--r-- | drivers/crypto/caam/qi.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index b6e7c0b29d4e..1e731ed8702b 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -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; |