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

Message ID 20231017062006.10879-1-kunyu@nfschina.com
State New
Headers
Series sched: topology: Remove unnecessary ‘0’ values from nr_levels |

Commit Message

Li kunyu Oct. 17, 2023, 6:20 a.m. UTC
  nr_levels is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 kernel/sched/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ingo Molnar Oct. 18, 2023, 12:15 p.m. UTC | #1
* Li kunyu <kunyu@nfschina.com> wrote:

> 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
  

Patch

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 05a5bc678c089..0ead4e72bc6ca 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -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;