[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5ada7b12-f3c4-4ae8-b396-a3e474f4f852@paulmck-laptop>
Date: Fri, 4 Oct 2024 08:41:26 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-snps-arc@...ts.infradead.org
Subject: Re: arch/arc/kernel/smp.c:267:18: sparse: sparse: cast removes
address space '__percpu' of expression
On Mon, Sep 30, 2024 at 09:10:27AM -0700, Paul E. McKenney wrote:
> On Wed, Sep 25, 2024 at 01:40:45PM +0800, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 684a64bf32b6e488004e0ad7f0d7e922798f65b6
> > commit: f2519d4d4fc4d36f2b58c5614357de9f5b4032fc ARC: Emulate one-byte cmpxchg
> > date: 12 days ago
> > config: arc-randconfig-r123-20240925 (https://download.01.org/0day-ci/archive/20240925/202409251336.ToC0TvWB-lkp@intel.com/config)
> > compiler: arc-elf-gcc (GCC) 13.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20240925/202409251336.ToC0TvWB-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@...el.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202409251336.ToC0TvWB-lkp@intel.com/
> >
> > sparse warnings: (new ones prefixed by >>)
> > arch/arc/kernel/smp.c:252:48: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long [noderef] __percpu *ipi_data_ptr @@ got unsigned long * @@
> > arch/arc/kernel/smp.c:252:48: sparse: expected unsigned long [noderef] __percpu *ipi_data_ptr
> > arch/arc/kernel/smp.c:252:48: sparse: got unsigned long *
> > arch/arc/kernel/smp.c:267:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile *v @@ got unsigned long [noderef] __percpu *__ai_ptr @@
> > arch/arc/kernel/smp.c:267:18: sparse: expected void const volatile *v
> > arch/arc/kernel/smp.c:267:18: sparse: got unsigned long [noderef] __percpu *__ai_ptr
> > >> arch/arc/kernel/smp.c:267:18: sparse: sparse: cast removes address space '__percpu' of expression
> > >> arch/arc/kernel/smp.c:267:18: sparse: sparse: cast removes address space '__percpu' of expression
>
> I could "fix" this using __force. Is that a reasonable approach?
>
> If I don't hear otherwise, I will take that approach.
Having not heard otherwise, does the following fix this issue for you?
Thanx, Paul
------------------------------------------------------------------------
diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index 58045c8983404..76f43db0890fc 100644
--- a/arch/arc/include/asm/cmpxchg.h
+++ b/arch/arc/include/asm/cmpxchg.h
@@ -48,7 +48,7 @@
\
switch(sizeof((_p_))) { \
case 1: \
- _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
+ _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
break; \
case 4: \
_prev_ = __cmpxchg(_p_, _o_, _n_); \
Powered by blists - more mailing lists