mirror of https://github.com/torvalds/linux.git
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
This commit is contained in:
parent
b1164c7d11
commit
52a1ec718b
|
|
@ -46,22 +46,22 @@ void unwind_deferred_task_exit(struct task_struct *task);
|
||||||
static __always_inline void unwind_reset_info(void)
|
static __always_inline void unwind_reset_info(void)
|
||||||
{
|
{
|
||||||
struct unwind_task_info *info = ¤t->unwind_info;
|
struct unwind_task_info *info = ¤t->unwind_info;
|
||||||
unsigned long bits;
|
unsigned long bits = info->unwind_mask;
|
||||||
|
|
||||||
/* Was there any unwinding? */
|
/* Was there any unwinding? */
|
||||||
if (unlikely(info->unwind_mask)) {
|
if (likely(!bits))
|
||||||
bits = info->unwind_mask;
|
return;
|
||||||
do {
|
|
||||||
/* Is a task_work going to run again before going back */
|
|
||||||
if (bits & UNWIND_PENDING)
|
|
||||||
return;
|
|
||||||
} while (!try_cmpxchg(&info->unwind_mask, &bits, 0UL));
|
|
||||||
current->unwind_info.id.id = 0;
|
|
||||||
|
|
||||||
if (unlikely(info->cache)) {
|
do {
|
||||||
info->cache->nr_entries = 0;
|
/* Is a task_work going to run again before going back */
|
||||||
info->cache->unwind_completed = 0;
|
if (bits & UNWIND_PENDING)
|
||||||
}
|
return;
|
||||||
|
} while (!try_cmpxchg(&info->unwind_mask, &bits, 0UL));
|
||||||
|
current->unwind_info.id.id = 0;
|
||||||
|
|
||||||
|
if (unlikely(info->cache)) {
|
||||||
|
info->cache->nr_entries = 0;
|
||||||
|
info->cache->unwind_completed = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue