Skip to content

Commit 88c79ec

Browse files
YuryNorovrostedt
authored andcommitted
tracing: Replace opencoded cpumask_next_wrap() in move_to_next_cpu()
The dedicated cpumask_next_wrap() is more verbose and effective than cpumask_next() followed by cpumask_first(). Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Yury Norov <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent d7b8f8e commit 88c79ec

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/trace/trace_hwlat.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,9 @@ static void move_to_next_cpu(void)
325325

326326
cpus_read_lock();
327327
cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask);
328-
next_cpu = cpumask_next(raw_smp_processor_id(), current_mask);
328+
next_cpu = cpumask_next_wrap(raw_smp_processor_id(), current_mask);
329329
cpus_read_unlock();
330330

331-
if (next_cpu >= nr_cpu_ids)
332-
next_cpu = cpumask_first(current_mask);
333-
334331
if (next_cpu >= nr_cpu_ids) /* Shouldn't happen! */
335332
goto change_mode;
336333

0 commit comments

Comments
 (0)