powerpc: Fix duplicate const clang warning in user access code
This re-applies commit
8160ac3d6fb0 ("powerpc: Fix duplicate const
clang warning in user access code") (Jun 2015) which was undone in
commits:
7161b0ba7693 ("powerpc/sparse: Constify the address pointer in __get_user_nosleep()") (Feb 2017)
bb97cf63c349 ("powerpc/sparse: Constify the address pointer in __get_user_nocheck()") (Feb 2017)
048f33cc2b91 ("powerpc/sparse: Constify the address pointer in __get_user_check()") (Feb 2017)
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@samba.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>