sched: remove unnecessary check in sched_{debug_}start()
PATCH 1/1 sched: remove unnecessary check in sched_{debug_}start()
-1 is a legal argument for cpumask_next(), and cpumask_next(-1, mask) is equivalent to cpumask_first(mask). The explicit check and separate branch are unnecessary.
Signed-off-by Fushuai Wang <[email protected]>
--- kernel/sched/debug.c | 5 +---- kernel/sched/stats.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-)
kernel/sched/debug.c +1 -4
@@ -1080,10 +1080,7 @@ static void *sched_debug_start(struct seq_file *file, loff_t *offset) n--; -if (n >0 ) - n =cpumask_next (n -1 , cpu_online_mask); -else - n =cpumask_first (cpu_online_mask); + n =cpumask_next (n -1 , cpu_online_mask); *offset = n +1 ;
kernel/sched/stats.c +1 -4
@@ -181,10 +181,7 @@ static void *schedstat_start(struct seq_file *file, loff_t *offset) n--; -if (n >0 ) - n =cpumask_next (n -1 , cpu_online_mask); -else - n =cpumask_first (cpu_online_mask); + n =cpumask_next (n -1 , cpu_online_mask); *offset = n +1 ;
Signature · 1 line
2.36.1
Quoted 5 lines · Fushuai Wang
-1 is a legal argument for
cpumask_next(), andcpumask_next(-1, mask)is equivalent tocpumask_first(mask). The explicit check and separate branch are unnecessary.Signed-off-by Fushuai Wang <[email protected]>
Reviewed-by Valentin Schneider <[email protected]>
Quoted 3 lines
-1 is a legal argument for
cpumask_next(), andcpumask_next(-1, mask)is equivalent tocpumask_first(mask). The explicit check and separate branch are unnecessary.
Gentle ping. This patch has been reviewed but not merged yet.
Regards,
Wang.