Skip to contentSkip to conversation

sched: topology: Remove unnecessary ‘0’ values from nr_levels

PATCH In review Li kunyu 2 participants 2 messages Oct 17, 2023 – Oct 18, 2023 Scheduler

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 sched: topology: Remove unnecessary ‘0’ values from nr_levels

nr_levels is assigned first, so it does not need to initialize the assignment.

---
 kernel/sched/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/topology.c +1 -1
index 05a5bc678c089..0ead4e72bc6ca 100644
@@ -1823,7 +1823,7 @@ void sched_init_numa(int offline_node)
 {
 	struct sched_domain_topology_level *tl;
 	unsigned long *distance_map;
-	int nr_levels = 0;
+	int nr_levels;
 	int i, j;
 	int *distances;
 	struct cpumask ***masks;
Signature · 1 line
2.18.2
#1 lore raw
Quoted 2 lines · Li kunyu

nr_levels is assigned first, so it does not need to initialize the assignment.

In C there's no such thing as "initializing the assignment"...

Please write sensible changelogs that demonstrate an understanding of these principles.

Thanks,

Ingo