From: Jens Remus Date: Mon, 8 Dec 2025 16:03:52 +0000 (+0100) Subject: x86/unwind_user: Simplify unwind_user_word_size() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c48808408af11d6f173c65eee9bd5ca4c53667c;p=thirdparty%2Fkernel%2Flinux.git x86/unwind_user: Simplify unwind_user_word_size() Get rid of superfluous ifdef and return explicit word size depending on 32-bit or 64-bit mode. Suggested-by: Linus Torvalds Signed-off-by: Jens Remus Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20251208160352.1363040-5-jremus@linux.ibm.com --- diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwind_user.h index 7f1229b33d06c..6e469044e4de0 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 */