sched/core: Stop using magic values in sched_dynamic_mode()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 25 Mar 2021 00:45:14 +0000 (01:45 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 25 Mar 2021 10:39:12 +0000 (11:39 +0100)
Use the enum names which are also what is used in the switch() in
sched_dynamic_update().

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: https://lore.kernel.org/r/20210325004515.531631-1-linux@rasmusvillemoes.dk
kernel/sched/core.c

index 3384ea74cad42ef2f2468ee0802247dbd26e3eee..1fe9d3f31a73830d4a7d9ee569eb7256a5a94439 100644 (file)
@@ -5376,13 +5376,13 @@ static int preempt_dynamic_mode = preempt_dynamic_full;
 static int sched_dynamic_mode(const char *str)
 {
        if (!strcmp(str, "none"))
-               return 0;
+               return preempt_dynamic_none;
 
        if (!strcmp(str, "voluntary"))
-               return 1;
+               return preempt_dynamic_voluntary;
 
        if (!strcmp(str, "full"))
-               return 2;
+               return preempt_dynamic_full;
 
        return -1;
 }