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_reset_info()

Invert the condition of the first if and make it an early exit to
reduce an indent level for the rest fo the function.

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

+13 -13
+13 -13
include/linux/unwind_deferred.h
··· 46 46 static __always_inline void unwind_reset_info(void) 47 47 { 48 48 struct unwind_task_info *info = &current->unwind_info; 49 - unsigned long bits; 49 + unsigned long bits = info->unwind_mask; 50 50 51 51 /* Was there any unwinding? */ 52 - if (unlikely(info->unwind_mask)) { 53 - bits = info->unwind_mask; 54 - do { 55 - /* Is a task_work going to run again before going back */ 56 - if (bits & UNWIND_PENDING) 57 - return; 58 - } while (!try_cmpxchg(&info->unwind_mask, &bits, 0UL)); 59 - current->unwind_info.id.id = 0; 52 + if (likely(!bits)) 53 + return; 60 54 61 - if (unlikely(info->cache)) { 62 - info->cache->nr_entries = 0; 63 - info->cache->unwind_completed = 0; 64 - } 55 + do { 56 + /* Is a task_work going to run again before going back */ 57 + if (bits & UNWIND_PENDING) 58 + return; 59 + } while (!try_cmpxchg(&info->unwind_mask, &bits, 0UL)); 60 + current->unwind_info.id.id = 0; 61 + 62 + if (unlikely(info->cache)) { 63 + info->cache->nr_entries = 0; 64 + info->cache->unwind_completed = 0; 65 65 } 66 66 } 67 67