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.

tracing/osnoise: Use for_each_online_cpu() instead of for_each_cpu()

Replace the opencoded for_each_cpu(cpu, cpu_online_mask) loop with the
more readable and equivalent for_each_online_cpu(cpu) macro.

Link: https://lore.kernel.org/20250811064158.2456-1-wangfushuai@baidu.com
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Fushuai Wang and committed by
Steven Rostedt (Google)
1d67d67a 09da5934

+2 -2
+2 -2
kernel/trace/trace_osnoise.c
··· 271 271 * So far, all the values are initialized as 0, so 272 272 * zeroing the structure is perfect. 273 273 */ 274 - for_each_cpu(cpu, cpu_online_mask) { 274 + for_each_online_cpu(cpu) { 275 275 tlat_var = per_cpu_ptr(&per_cpu_timerlat_var, cpu); 276 276 if (tlat_var->kthread) 277 277 hrtimer_cancel(&tlat_var->timer); ··· 295 295 * So far, all the values are initialized as 0, so 296 296 * zeroing the structure is perfect. 297 297 */ 298 - for_each_cpu(cpu, cpu_online_mask) { 298 + for_each_online_cpu(cpu) { 299 299 osn_var = per_cpu_ptr(&per_cpu_osnoise_var, cpu); 300 300 memset(osn_var, 0, sizeof(*osn_var)); 301 301 }