Changed cpumask_next to wrap instead of terminating after nr_cpus.
Subsystems (3)
PATCH 1/1 Changed cpumask_next to wrap instead of terminating after nr_cpus.
Changed cpumask_next() to wrap instead of terminating after nr_cpus.
Signed-off-by Cade Richard <[email protected]>
--- lib/cpumask.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/cpumask.h +4 -2
@@ -109,8 +109,10 @@ static inline void cpumask_copy(cpumask_t *dst, const cpumask_t *src)static inline int cpumask_next (int cpu,const cpumask_t *mask) { -while (++cpu < nr_cpus && !cpumask_test_cpu (cpu, mask)) - ; +do { +if (++cpu > nr_cpus) + cpu =0 ; + }while (!cpumask_test_cpu (cpu, mask));return cpu; }
Signature · 1 line
2.43.0
Andrew Jones
NAKPatch summaries shouldn't have periods and they should be concise.
Quoted 12 lines · Cade Richard
Changed
cpumask_next()to wrap instead of terminating afternr_cpus.Signed-off-by Cade Richard <[email protected]>--- lib/cpumask.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)lib/cpumask.h +0
-0
lib/cpumask.h static inline void cpumask_copy(cpumask_t *dst, const cpumask_t *src) · line 113
Quoted 7 lines
lib/cpumask.h +2
-2@@ -109,8 +109,10 @@ static inline void cpumask_copy(cpumask_t *dst, const cpumask_t *src)static inline int cpumask_next (int cpu,const cpumask_t *mask) { -while (++cpu < nr_cpus && !cpumask_test_cpu (cpu, mask)) - ; + do { + if (++cpu > nr_cpus)
Should be ++cpu == nr_cpus, but...
lib/cpumask.h static inline void cpumask_copy(cpumask_t *dst, const cpumask_t *src) · line 115
Quoted 2 lines
lib/cpumask.h +2
-0+ cpu =0 ; + }while (!cpumask_test_cpu (cpu, mask));
...this will break everything. See for_each_cpu().
Nack
drew
Quoted 11 lines
lib/cpumask.h +0
-0return cpu; }Signature · 7 lines
2.43.0 -- kvm-riscv mailing list kvm-riscv at lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv