mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manuel Ebner <manuelebnerli@mailbox.org>
To: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Manuel Ebner <manuelebnerli@mailbox.org>, linux-kernel@vger.kernel.org
Subject: [Question] sched: rt.c: kernel-doc warning
Date: Mon,  5 Oct 2026 09:27:38 +0200	[thread overview]
Message-ID: <20261005072738.2902503-2-manuelebnerli@mailbox.org> (raw)

Hi,

I'm trying to fix built warning and stumbled over this one:

$make W=1 -j8 > make_output.txt
In file included from kernel/sched/build_policy.c:52:
kernel/sched/rt.c:12:18: warning: ‘max_rt_runtime’ defined but not used [-Wunused-const-variable=]
   12 | static const u64 max_rt_runtime = MAX_BW;
      |                  ^~~~~~~~~~~~~~

I just can't make sense of this, because max_rt_runtime is used later in the
file - see diff.
What am I missing?

Thanks
 Manuel Ebner
---
 kernel/sched/rt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 1535046a2..4d15f5c47 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -10,6 +10,14 @@
 int sched_rr_timeslice = RR_TIMESLICE;
 /* More than 4 hours if BW_SHIFT equals 20. */
 static const u64 max_rt_runtime = MAX_BW;
+/* When I build a tinyconfig this warning is triggered
+ *
+ * $make W=1 -j8 > make_output.txt
+ * In file included from kernel/sched/build_policy.c:52:
+ * kernel/sched/rt.c:12:18: warning: ‘max_rt_runtime’ defined but not used [-Wunused-const-variable=]
+ *   12 | static const u64 max_rt_runtime = MAX_BW;
+ *      |                  ^~~~~~~~~~~~~~
+ */
 
 /*
  * period over which we measure -rt task CPU usage in us.
@@ -2766,6 +2774,9 @@ static int tg_set_rt_bandwidth(struct task_group *tg,
 	 * Bound quota to defend quota against overflow during bandwidth shift.
 	 */
 	if (rt_runtime != RUNTIME_INF && rt_runtime > max_rt_runtime)
+/* 
+ * here max_rt_runtime is obviosly used
+ */
 		return -EINVAL;
 
 	mutex_lock(&rt_constraints_mutex);
@@ -2857,6 +2868,9 @@ static int sched_rt_global_validate(void)
 		((sysctl_sched_rt_runtime > sysctl_sched_rt_period) ||
 		 ((u64)sysctl_sched_rt_runtime *
 			NSEC_PER_USEC > max_rt_runtime)))
+/*
+ * here it is used again
+ */
 		return -EINVAL;
 
 #ifdef CONFIG_RT_GROUP_SCHED
-- 
2.55.0


             reply	other threads:[~2026-10-05  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  7:27 Manuel Ebner [this message]
2026-10-12  9:45 ` K Prateek Nayak

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=20261005072738.2902503-2-manuelebnerli@mailbox.org \
    --to=manuelebnerli@mailbox.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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®