]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arch/sh/kernel/traps_64.c: use sign_extend64() for sign extension
authorMartin Kepplinger <martink@posteo.de>
Wed, 21 Oct 2015 22:03:51 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:51 +0000 (09:03 +1100)
Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: George Spelvin <linux@horizon.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Yury Norov <yury.norov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sh/kernel/traps_64.c

index 112ea11c030d68ef6bcfbd0ec1ab8148b7db327f..d208c27ccc67c0738c38f327175fcb18135ee7c2 100644 (file)
@@ -101,7 +101,7 @@ static int generate_and_check_address(struct pt_regs *regs,
        if (displacement_not_indexed) {
                __s64 displacement;
                displacement = (opcode >> 10) & 0x3ff;
-               displacement = ((displacement << 54) >> 54); /* sign extend */
+               displacement = sign_extend64(displacement, 9);
                addr = (__u64)((__s64)base_address + (displacement << width_shift));
        } else {
                __u64 offset;