Commit 3312eca5 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Ralf Baechle

MIPS: Octeon: mangle-port: fix build failure with VDSO code

Commit 1685ddbe ("MIPS: Octeon: Changes to support readq()/writeq()
usage.") added bitwise shift operations that assume that unsigned long
is always 64-bits. This broke the build of VDSO code, as it gets compiled
also in "faked" 32-bit mode. Althought the failing inline functions are
never executed in 32-bit mode, they still need to pass the compilation.
Fix by using 64-bit types explicitly.

The patch fixes the following build failure:

  CC      arch/mips/vdso/gettimeofday-o32.o
In file included from los/git/devel/linux/arch/mips/include/asm/io.h:32:0,
                 from los/git/devel/linux/arch/mips/include/asm/page.h:194,
                 from los/git/devel/linux/arch/mips/vdso/vdso.h:26,
                 from los/git/devel/linux/arch/mips/vdso/gettimeofday.c:11:
los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h: In function '__should_swizzle_bits':
los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h:19:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
  unsigned long did = ((unsigned long)a >> 40) & 0xff;
                                        ^~

Fixes: 1685ddbe ("MIPS: Octeon: Changes to support readq()/writeq() usage.")
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Steven J. Hill <steven.hill@cavium.com>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14039/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent b244614a
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
static inline bool __should_swizzle_bits(volatile void *a) static inline bool __should_swizzle_bits(volatile void *a)
{ {
extern const bool octeon_should_swizzle_table[]; extern const bool octeon_should_swizzle_table[];
u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
unsigned long did = ((unsigned long)a >> 40) & 0xff;
return octeon_should_swizzle_table[did]; return octeon_should_swizzle_table[did];
} }
...@@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a) ...@@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a)
#define __should_swizzle_bits(a) false #define __should_swizzle_bits(a) false
static inline bool __should_swizzle_addr(unsigned long p) static inline bool __should_swizzle_addr(u64 p)
{ {
/* boot bus? */ /* boot bus? */
return ((p >> 40) & 0xff) == 0; return ((p >> 40) & 0xff) == 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment