All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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 *'
Date: Tue, 18 Feb 2025 01:12:28 +0800	[thread overview]
Message-ID: <202502180117.vtskxZS0-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-02-17 17:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202502180117.vtskxZS0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=memxor@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.