Get rid of superfluous ifdef and return explicit word size depending on
32-bit or 64-bit mode.

Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Jens Remus <[email protected]>
---

Notes (jremus):
    Changes in v4:
    - New patch. (Linus)
      
https://lore.kernel.org/all/CAHk-=wh4_bpvniqzqveq4ccc3wfvqqruwk0b1yek+0d5s1l...@mail.gmail.com/
    
    This aligns to sizeof_long() in arch/x86/kernel/uprobes.c.

 arch/x86/include/asm/unwind_user.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/unwind_user.h 
b/arch/x86/include/asm/unwind_user.h
index 7f1229b33d06..6e469044e4de 100644
--- a/arch/x86/include/asm/unwind_user.h
+++ b/arch/x86/include/asm/unwind_user.h
@@ -12,11 +12,7 @@ static inline int unwind_user_word_size(struct pt_regs *regs)
        /* We can't unwind VM86 stacks */
        if (regs->flags & X86_VM_MASK)
                return 0;
-#ifdef CONFIG_X86_64
-       if (!user_64bit_mode(regs))
-               return sizeof(int);
-#endif
-       return sizeof(long);
+       return user_64bit_mode(regs) ? 8 : 4;
 }
 
 #endif /* CONFIG_UNWIND_USER */
-- 
2.51.0


Reply via email to