MIPS: signal.c: Fix an invalid cast in ISA mode bit handling
authorMaciej W. Rozycki <macro@codesourcery.com>
Sat, 15 Nov 2014 22:08:09 +0000 (22:08 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:36 +0000 (07:45 +0100)
Fix:

arch/mips/kernel/signal.c: In function 'handle_signal':
arch/mips/kernel/signal.c:533:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  unsigned int tmp = (unsigned int)current->mm->context.vdso;
                     ^
arch/mips/kernel/signal.c:536:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  vdso = (void *)tmp;
         ^
cc1: all warnings being treated as errors

when building a 64-bit kernel.

This is not really a supported configuration, but the cast is wrong
either way, Linux makes the assumption that sizeof(void *) equals
sizeof(unsigned long) and therefore the latter type is expected to be
used where integer operations have to be applied to pointers for some
reason.

Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8480/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/signal.c

index 1d57605e4615288a604403de1a7071d7112b20c0..0422bf1f0047bb242d3d0925c15d54374ef0a73b 100644 (file)
@@ -530,7 +530,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
        struct mips_abi *abi = current->thread.abi;
 #ifdef CONFIG_CPU_MICROMIPS
        void *vdso;
-       unsigned int tmp = (unsigned int)current->mm->context.vdso;
+       unsigned long tmp = (unsigned long)current->mm->context.vdso;
 
        set_isa16_mode(tmp);
        vdso = (void *)tmp;