Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add const qual to local_read() parameter

A patch in net-next triggered a compile error on powerpc:

include/linux/u64_stats_sync.h: In function 'u64_stats_read':
include/asm-generic/local64.h:30:37: warning: passing argument 1 of 'local_read' discards 'const' qualifier from pointer target type

This seems reasonable to relax powerpc local_read() requirements.

Fixes: 316580b69d0a ("u64_stats: provide u64_stats_t type")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: kbuild test robot <lkp@intel.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build only
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

authored by

Eric Dumazet and committed by
Jakub Kicinski
c392bccf c98dfcd3

+1 -1
+1 -1
arch/powerpc/include/asm/local.h
··· 17 17 18 18 #define LOCAL_INIT(i) { (i) } 19 19 20 - static __inline__ long local_read(local_t *l) 20 + static __inline__ long local_read(const local_t *l) 21 21 { 22 22 return READ_ONCE(l->v); 23 23 }