[v2, 4/5] powerpc: Fix duplicate const clang warning in user access code

Michael Ellerman patch-notifications at ellerman.id.au
Thu Sep 20 14:21:04 AEST 2018


On Fri, 2018-09-14 at 04:06:48 UTC, Joel Stanley wrote:
> From: Anton Blanchard <anton at samba.org>
> 
> This re-applies b91c1e3e7a6f which was reverted in f2ca80905929
> d466f6c5cac1 f84ed59a612d (powerpc/sparse: Constify the address pointer
> ...").
> 
> We see a large number of duplicate const errors in the user access
> code when building with llvm/clang:
> 
>   include/linux/pagemap.h:576:8: warning: duplicate 'const' declaration specifier
>       [-Wduplicate-decl-specifier]
>         ret = __get_user(c, uaddr);
> 
> The problem is we are doing const __typeof__(*(ptr)), which will hit the
> warning if ptr is marked const.
> 
> Removing const does not seem to have any effect on GCC code generation.
> 
> Signed-off-by: Anton Blanchard <anton at samba.org>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> Reviewed-by: Nick Desaulniers <ndesaulniers at google.com>

Applied to powerpc next, thanks.

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

cheers


More information about the Linuxppc-dev mailing list