Skip to content

Commit b91c1e3

Browse files
antonblanchardmpe
authored andcommitted
powerpc: Fix duplicate const clang warning in user access code
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent e633bc8 commit b91c1e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/powerpc/include/asm/uaccess.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ do { \
265265
({ \
266266
long __gu_err; \
267267
unsigned long __gu_val; \
268-
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
268+
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
269269
__chk_user_ptr(ptr); \
270270
if (!is_kernel_addr((unsigned long)__gu_addr)) \
271271
might_fault(); \
@@ -279,7 +279,7 @@ do { \
279279
({ \
280280
long __gu_err; \
281281
long long __gu_val; \
282-
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
282+
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
283283
__chk_user_ptr(ptr); \
284284
if (!is_kernel_addr((unsigned long)__gu_addr)) \
285285
might_fault(); \
@@ -293,7 +293,7 @@ do { \
293293
({ \
294294
long __gu_err = -EFAULT; \
295295
unsigned long __gu_val = 0; \
296-
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
296+
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
297297
might_fault(); \
298298
if (access_ok(VERIFY_READ, __gu_addr, (size))) \
299299
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
@@ -305,7 +305,7 @@ do { \
305305
({ \
306306
long __gu_err; \
307307
unsigned long __gu_val; \
308-
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
308+
__typeof__(*(ptr)) __user *__gu_addr = (ptr); \
309309
__chk_user_ptr(ptr); \
310310
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
311311
(x) = (__force __typeof__(*(ptr)))__gu_val; \

0 commit comments

Comments
 (0)