mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] sched: stop using magic values in sched_dynamic_mode
@ 2021-03-25  0:45 Rasmus Villemoes
  2021-03-25  0:45 ` [PATCH 2/2] sched: use -EINVAL " Rasmus Villemoes
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rasmus Villemoes @ 2021-03-25  0:45 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel, Rasmus Villemoes

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>
---
 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-25 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  0:45 [PATCH 1/2] sched: stop using magic values in sched_dynamic_mode Rasmus Villemoes
2021-03-25  0:45 ` [PATCH 2/2] sched: use -EINVAL " Rasmus Villemoes
2021-03-25 11:08   ` [tip: sched/core] sched/core: Use -EINVAL in sched_dynamic_mode() tip-bot2 for Rasmus Villemoes
2021-03-25  7:48 ` [PATCH 1/2] sched: stop using magic values in sched_dynamic_mode Peter Zijlstra
2021-03-25 11:08 ` [tip: sched/core] sched/core: Stop using magic values in sched_dynamic_mode() tip-bot2 for Rasmus Villemoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®