[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6C18D4916C41C8D7+20250311090714.902321-1-wangyuli@uniontech.com>
Date: Tue, 11 Mar 2025 17:07:14 +0800
From: WangYuli <wangyuli@...ontech.com>
To: mingo@...hat.com,
peterz@...radead.org,
juri.lelli@...hat.com,
vincent.guittot@...aro.org,
dietmar.eggemann@....com,
rostedt@...dmis.org,
bsegall@...gle.com,
mgorman@...e.de,
vschneid@...hat.com
Cc: linux-kernel@...r.kernel.org,
zhanjun@...ontech.com,
niecheng1@...ntech.com,
guanwentao@...ontech.com,
chenlinxuan@...ontech.com,
WangYuli <wangyuli@...ontech.com>
Subject: [PATCH] sched/core: u_clamp: Fix "-Wunused-function" warnings
Given that uclamp_update_active() is exclusively called by
uclamp_update_active_tasks(), and considering that
uclamp_update_active_tasks() is utilized solely when
CONFIG_UCLAMP_TASK_GROUP is enabled, it follows that
uclamp_update_active() will emit a compilation warning if
CONFIG_UCLAMP_TASK_GROUP is not enabled.
Similar reason of uclamp_rq_reinc_id().
Fix follow errors with clang-19 when W=1e:
kernel/sched/core.c:1818:1: error: unused function 'uclamp_update_active' [-Werror,-Wunused-function]
1818 | uclamp_update_active(struct task_struct *p)
| ^~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:1800:20: error: unused function 'uclamp_rq_reinc_id' [-Werror,-Wunused-function]
1800 | static inline void uclamp_rq_reinc_id(struct rq *rq, struct task_struct *p,
| ^~~~~~~~~~~~~~~~~~
Signed-off-by: WangYuli <wangyuli@...ontech.com>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 67189907214d..49549e030f4c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1797,6 +1797,7 @@ static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p)
uclamp_rq_dec_id(rq, p, clamp_id);
}
+#ifdef CONFIG_UCLAMP_TASK_GROUP
static inline void uclamp_rq_reinc_id(struct rq *rq, struct task_struct *p,
enum uclamp_id clamp_id)
{
@@ -1843,7 +1844,6 @@ uclamp_update_active(struct task_struct *p)
task_rq_unlock(rq, p, &rf);
}
-#ifdef CONFIG_UCLAMP_TASK_GROUP
static inline void
uclamp_update_active_tasks(struct cgroup_subsys_state *css)
{
--
2.47.2
Powered by blists - more mailing lists