* [kkdwivedi:res-lock-base 20/26] kernel/bpf/percpu_freelist.c:38:24: error: incompatible pointer types passing 'rqspinlock_t *' (aka 'struct rqspinlock *') to parameter of type 'struct qspinlock *'
@ 2025-02-17 17:12 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-17 17:12 UTC (permalink / raw)
To: Kumar Kartikeya Dwivedi; +Cc: oe-kbuild-all
tree: https://github.com/kkdwivedi/linux res-lock-base
head: f998e0817b8a89691123f4a4a6e1277c22523695
commit: b93ebda0fc9e433a04a84dc63e762f0a3a8d9431 [20/26] bpf: Convert percpu_freelist.c to rqspinlock
config: x86_64-buildonly-randconfig-006-20250217 (https://download.01.org/0day-ci/archive/20250218/202502180117.vtskxZS0-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250218/202502180117.vtskxZS0-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502180117.vtskxZS0-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from kernel/bpf/percpu_freelist.c:4:
In file included from kernel/bpf/percpu_freelist.h:8:
In file included from arch/x86/include/asm/rqspinlock.h:27:
include/asm-generic/rqspinlock.h:33:12: error: conflicting types for 'resilient_tas_spin_lock'
33 | extern int resilient_tas_spin_lock(rqspinlock_t *lock, u64 timeout);
| ^
arch/x86/include/asm/rqspinlock.h:17:12: note: previous declaration is here
17 | extern int resilient_tas_spin_lock(struct qspinlock *lock, u64 timeout);
| ^
>> kernel/bpf/percpu_freelist.c:38:24: error: incompatible pointer types passing 'rqspinlock_t *' (aka 'struct rqspinlock *') to parameter of type 'struct qspinlock *' [-Werror,-Wincompatible-pointer-types]
38 | if (raw_res_spin_lock(&head->lock))
| ^~~~~~~~~~~
include/asm-generic/rqspinlock.h:188:25: note: expanded from macro 'raw_res_spin_lock'
188 | __ret = res_spin_lock(lock); \
| ^~~~
include/asm-generic/rqspinlock.h:156:53: note: expanded from macro 'res_spin_lock'
156 | #define res_spin_lock(lock) resilient_tas_spin_lock(lock, RES_DEF_TIMEOUT)
| ^~~~
arch/x86/include/asm/rqspinlock.h:17:54: note: passing argument to parameter 'lock' here
17 | extern int resilient_tas_spin_lock(struct qspinlock *lock, u64 timeout);
| ^
kernel/bpf/percpu_freelist.c:59:26: error: incompatible pointer types passing 'rqspinlock_t *' (aka 'struct rqspinlock *') to parameter of type 'struct qspinlock *' [-Werror,-Wincompatible-pointer-types]
59 | if (raw_res_spin_lock(&head->lock))
| ^~~~~~~~~~~
include/asm-generic/rqspinlock.h:188:25: note: expanded from macro 'raw_res_spin_lock'
188 | __ret = res_spin_lock(lock); \
| ^~~~
include/asm-generic/rqspinlock.h:156:53: note: expanded from macro 'res_spin_lock'
156 | #define res_spin_lock(lock) resilient_tas_spin_lock(lock, RES_DEF_TIMEOUT)
| ^~~~
arch/x86/include/asm/rqspinlock.h:17:54: note: passing argument to parameter 'lock' here
17 | extern int resilient_tas_spin_lock(struct qspinlock *lock, u64 timeout);
| ^
kernel/bpf/percpu_freelist.c:110:25: error: incompatible pointer types passing 'rqspinlock_t *' (aka 'struct rqspinlock *') to parameter of type 'struct qspinlock *' [-Werror,-Wincompatible-pointer-types]
110 | if (raw_res_spin_lock(&head->lock))
| ^~~~~~~~~~~
include/asm-generic/rqspinlock.h:188:25: note: expanded from macro 'raw_res_spin_lock'
188 | __ret = res_spin_lock(lock); \
| ^~~~
include/asm-generic/rqspinlock.h:156:53: note: expanded from macro 'res_spin_lock'
156 | #define res_spin_lock(lock) resilient_tas_spin_lock(lock, RES_DEF_TIMEOUT)
| ^~~~
arch/x86/include/asm/rqspinlock.h:17:54: note: passing argument to parameter 'lock' here
17 | extern int resilient_tas_spin_lock(struct qspinlock *lock, u64 timeout);
| ^
4 errors generated.
vim +38 kernel/bpf/percpu_freelist.c
> 4 #include "percpu_freelist.h"
5
6 int pcpu_freelist_init(struct pcpu_freelist *s)
7 {
8 int cpu;
9
10 s->freelist = alloc_percpu(struct pcpu_freelist_head);
11 if (!s->freelist)
12 return -ENOMEM;
13
14 for_each_possible_cpu(cpu) {
15 struct pcpu_freelist_head *head = per_cpu_ptr(s->freelist, cpu);
16
17 raw_res_spin_lock_init(&head->lock);
18 head->first = NULL;
19 }
20 return 0;
21 }
22
23 void pcpu_freelist_destroy(struct pcpu_freelist *s)
24 {
25 free_percpu(s->freelist);
26 }
27
28 static inline void pcpu_freelist_push_node(struct pcpu_freelist_head *head,
29 struct pcpu_freelist_node *node)
30 {
31 node->next = head->first;
32 WRITE_ONCE(head->first, node);
33 }
34
35 static inline bool ___pcpu_freelist_push(struct pcpu_freelist_head *head,
36 struct pcpu_freelist_node *node)
37 {
> 38 if (raw_res_spin_lock(&head->lock))
39 return false;
40 pcpu_freelist_push_node(head, node);
41 raw_res_spin_unlock(&head->lock);
42 return true;
43 }
44
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-17 17:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 17:12 [kkdwivedi:res-lock-base 20/26] kernel/bpf/percpu_freelist.c:38:24: error: incompatible pointer types passing 'rqspinlock_t *' (aka 'struct rqspinlock *') to parameter of type 'struct qspinlock *' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.