* [PATCH] sched/core: Fix setup_preempt_mode() return values
@ 2021-11-24 15:42 Nicolas Saenz Julienne
0 siblings, 0 replies; only message in thread
From: Nicolas Saenz Julienne @ 2021-11-24 15:42 UTC (permalink / raw)
To: peterz
Cc: mingo, juri.lelli, frederic, linux-kernel, mtosatti, mgorman,
bsegall, rostedt, dietmar.eggemann, bristot, vincent.guittot,
Nicolas Saenz Julienne
__setup() expects its setup_func() implementations to return 1 on
success and 0 otherwise. So let's honor that.
This gets rid of the following kernel log:
"Unknown kernel command line parameters "preempt=full", will be
passed to user space."
Fixes: 826bfeb37bb4 ("preempt/dynamic: Support dynamic preempt with preempt= boot option")
Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
---
An alternative fix would be using early_param() instead of __setup(),
which actually takes 0 as success. But I figure __setup() was chosen for
a reason.
kernel/sched/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cd61e4109eecc..0d6eab5eeb4c9 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6657,11 +6657,11 @@ static int __init setup_preempt_mode(char *str)
int mode = sched_dynamic_mode(str);
if (mode < 0) {
pr_warn("Dynamic Preempt: unsupported mode: %s\n", str);
- return 1;
+ return 0;
}
sched_dynamic_update(mode);
- return 0;
+ return 1;
}
__setup("preempt=", setup_preempt_mode);
--
2.33.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-24 15:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 15:42 [PATCH] sched/core: Fix setup_preempt_mode() return values Nicolas Saenz Julienne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).