Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

unwind: Simplify unwind_user_next_fp() alignment check

2^log_2(n) == n

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://patch.msgid.link/20250924080119.497867836@infradead.org

+1 -3
+1 -3
kernel/unwind/user.c
··· 19 19 { 20 20 const struct unwind_user_frame *frame = &fp_frame; 21 21 unsigned long cfa, fp, ra; 22 - unsigned int shift; 23 22 24 23 if (frame->use_fp) { 25 24 if (state->fp < state->sp) ··· 36 37 return -EINVAL; 37 38 38 39 /* Make sure that the address is word aligned */ 39 - shift = sizeof(long) == 4 ? 2 : 3; 40 - if (cfa & ((1 << shift) - 1)) 40 + if (cfa & (sizeof(long) - 1)) 41 41 return -EINVAL; 42 42 43 43 /* Find the Return Address (RA) */