lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/10] sched/topology: Replace 1 and 0 by boolean value
Date
From: Jules Irenge <jbi.octave@example.com>

Coccinelle reports a warning inside sched_energy_aware_handler()

WARNING: Assignment of 0/1 to bool variable

To fix this, 1 is replaced by true and 0 by false.
Given that variable sched_energy_update is of bool type.
This fixes the warnings.

Signed-off-by: Jules Irenge <jbi.octave@example.com>
---
kernel/sched/topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index dfb64c08a407..9d70cc68e549 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -221,9 +221,9 @@ int sched_energy_aware_handler(struct ctl_table *table, int write,
state = static_branch_unlikely(&sched_energy_present);
if (state != sysctl_sched_energy_aware) {
mutex_lock(&sched_energy_mutex);
- sched_energy_update = 1;
+ sched_energy_update = true;
rebuild_sched_domains();
- sched_energy_update = 0;
+ sched_energy_update = false;
mutex_unlock(&sched_energy_mutex);
}
}
--
2.25.1
\
 
 \ /
  Last update: 2020-03-27 22:25    [W:0.062 / U:2.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site