From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: [PATCH 1/2] sched: stop using magic values in sched_dynamic_mode
Date: Thu, 25 Mar 2021 01:45:14 +0100 [thread overview]
Message-ID: <20210325004515.531631-1-linux@rasmusvillemoes.dk> (raw)
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
next reply other threads:[~2021-03-25 0:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 0:45 Rasmus Villemoes [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210325004515.531631-1-linux@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®