Messages in this thread Patch in this message | | | Subject | Re: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same linked list | From | Waiman Long <> | Date | Thu, 5 Oct 2017 14:01:27 -0400 |
| |
On 10/05/2017 01:40 PM, Davidlohr Bueso wrote: > This is still spitting: > > lib/dlock-list.c: In function ‘cpu2idx_init’: > lib/dlock-list.c:75:16: error: incompatible types when assigning to > type ‘cpumask_var_t’ from type ‘struct cpumask *’ > sibling_mask = topology_sibling_cpumask(cpu); > ^ > lib/dlock-list.c:76:7: warning: the address of ‘sibling_mask’ will > always evaluate as ‘true’ [-Waddress] > if (sibling_mask) { > ^
Thanks for reporting this problem. Dealing with cpumask is always tricky. Could you try the following patch to see if it could fix the problem.
Thanks, Longman
----------------------------------------------------
diff --git a/lib/dlock-list.c b/lib/dlock-list.c index f0df7d5..3afd76d 100644 --- a/lib/dlock-list.c +++ b/lib/dlock-list.c @@ -60,7 +60,7 @@ static int __init cpu2idx_init(void) { int idx, cpu; - cpumask_var_t sibling_mask; + struct cpumask *sibling_mask; static struct cpumask mask __initdata; cpumask_clear(&mask); @@ -74,11 +74,9 @@ static int __init cpu2idx_init(void) cpumask_set_cpu(cpu, &mask); sibling_mask = topology_sibling_cpumask(cpu); - if (sibling_mask) { - for_each_cpu(scpu, sibling_mask) { - per_cpu(cpu2idx, scpu) = idx; - cpumask_set_cpu(scpu, &mask); - } + for_each_cpu(scpu, sibling_mask) { + per_cpu(cpu2idx, scpu) = idx; + cpumask_set_cpu(scpu, &mask); } idx++; }
| |