[PATCH] sched/core: Fix setup_preempt_mode() return values
From: Nicolas Saenz Julienne
Date: Wed Nov 24 2021 - 10:42:54 EST
__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@xxxxxxxxxx>
---
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