powerpc: Fix __cmpxchg() to take a volatile ptr again

Michael Ellerman patch-notifications at ellerman.id.au
Mon Nov 28 23:15:17 AEDT 2016


On Fri, 2016-11-25 at 03:07:09 UTC, Michael Ellerman wrote:
> In commit d0563a1297e2 ("powerpc: Implement {cmp}xchg for u8 and u16")
> we removed the volatile from __cmpxchg().
> 
> This is leading to warnings such as:
> 
>   drivers/gpu/drm/drm_lock.c: In function ‘drm_lock_take’:
>   arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1
>   of ‘__cmpxchg’ discards ‘volatile’ qualifier from pointer target
>      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,   \
> 
> There doesn't seem to be consensus across architectures whether the
> argument is volatile or not, so at least for now put the volatile back.
> 
> Fixes: d0563a1297e2 ("powerpc: Implement {cmp}xchg for u8 and u16")
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/da58b23cb976ab83a80d358102e139

cheers


More information about the Linuxppc-dev mailing list