The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched: simplify sched_init_numa()
@ 2025-07-19 21:07 Yury Norov
  2025-07-21  8:32 ` Srikar Dronamraju
  0 siblings, 1 reply; 4+ messages in thread
From: Yury Norov @ 2025-07-19 21:07 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, linux-kernel
  Cc: Yury Norov

From: Yury Norov (NVIDIA) <yury.norov@gmail.com>

The function opencodes for_each_set_bit() macro.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
---
 kernel/sched/topology.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index b958fe48e020..7dc3c79aa480 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1932,10 +1932,9 @@ void sched_init_numa(int offline_node)
 		return;
 	}
 
-	for (i = 0, j = 0; i < nr_levels; i++, j++) {
-		j = find_next_bit(distance_map, NR_DISTANCE_VALUES, j);
-		distances[i] = j;
-	}
+	for_each_set_bit(j, distance_map, NR_DISTANCE_VALUES)
+		distances[i++] = j;
+
 	rcu_assign_pointer(sched_domains_numa_distance, distances);
 
 	bitmap_free(distance_map);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-19 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-19 21:07 [PATCH] sched: simplify sched_init_numa() Yury Norov
2025-07-21  8:32 ` Srikar Dronamraju
2025-08-19  8:52   ` Valentin Schneider
2025-08-19 14:14     ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox