mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org,
	Zhan Xusheng <zhanxusheng@xiaomi.com>
Subject: [PATCH] sched: cleanup sched_update_scaling() return type and usage
Date: Tue, 20 Jan 2026 20:32:57 +0800	[thread overview]
Message-ID: <20260120123257.40875-1-zhanxusheng@xiaomi.com> (raw)

The function sched_update_scaling() always returned 0 and callers never
checked its return value. This patch removes the return value and changes
the function to return void for clarity.

The usage of the return value in kernel/sched/debug.c has also been
updated to reflect this change. This cleanup improves code readability
and eliminates unnecessary logic.

Tested:
- Kernel compiled successfully
- sched_update_scaling() invoked without errors
- No regressions in scheduler-related functionality

Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
 kernel/sched/debug.c | 3 +--
 kernel/sched/fair.c  | 4 +---
 kernel/sched/sched.h | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 41caa22e0680..d74c02297b42 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -189,8 +189,7 @@ static ssize_t sched_scaling_write(struct file *filp, const char __user *ubuf,
 		return -EINVAL;
 
 	sysctl_sched_tunable_scaling = scaling;
-	if (sched_update_scaling())
-		return -EINVAL;
+	sched_update_scaling();
 
 	*ppos += cnt;
 	return cnt;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e71302282671..234437ddd4c0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1004,7 +1004,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
 /**************************************************************
  * Scheduling class statistics methods:
  */
-int sched_update_scaling(void)
+void sched_update_scaling(void)
 {
 	unsigned int factor = get_update_sysctl_factor();
 
@@ -1012,8 +1012,6 @@ int sched_update_scaling(void)
 	(normalized_sysctl_##name = sysctl_##name / (factor))
 	WRT_SYSCTL(sched_base_slice);
 #undef WRT_SYSCTL
-
-	return 0;
 }
 
 static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 93fce4bbff5e..c9ef6cd7b754 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2168,7 +2168,7 @@ extern int group_balance_cpu(struct sched_group *sg);
 extern void update_sched_domain_debugfs(void);
 extern void dirty_sched_domain_sysctl(int cpu);
 
-extern int sched_update_scaling(void);
+extern void sched_update_scaling(void);
 
 static inline const struct cpumask *task_user_cpus(struct task_struct *p)
 {
-- 
2.43.0


             reply	other threads:[~2026-01-20 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 12:32 Zhan Xusheng [this message]
2026-01-20 20:00 ` Shubhang Kaushik

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=20260120123257.40875-1-zhanxusheng@xiaomi.com \
    --to=zhanxusheng1024@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhanxusheng@xiaomi.com \
    /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®