cpumask: fix checking valid cpu range
authorYury Norov <yury.norov@gmail.com>
Mon, 19 Sep 2022 21:05:53 +0000 (14:05 -0700)
committerYury Norov <yury.norov@gmail.com>
Sat, 1 Oct 2022 17:22:58 +0000 (10:22 -0700)
commit78e5a3399421ad79fc024e6d78e2deb7809d26af
tree300d0095c49837a9b1e74417dd58d75660c46730
parent8173aa26260e6d0153db0c7135d41a4da612da5b
cpumask: fix checking valid cpu range

The range of valid CPUs is [0, nr_cpu_ids). Some cpumask functions are
passed with a shifted CPU index, and for them, the valid range is
[-1, nr_cpu_ids-1). Currently for those functions, we check the index
against [-1, nr_cpu_ids), which is wrong.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
include/linux/cpumask.h