lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same linked list
From
Date
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++;
}
\
 
 \ /
  Last update: 2017-10-05 20:02    [W:1.804 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site