[PATCH 1/2] sched: stop using magic values in sched_dynamic_mode

From: Rasmus Villemoes
Date: Wed Mar 24 2021 - 20:46:14 EST


Use the enum names which are also what is used in the switch() in
sched_dynamic_update().

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
kernel/sched/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 98191218d891..3959481261bb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5370,13 +5370,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;
}
--
2.29.2