[PATCH] sched/rt: fix compilation on i386 for umax_rt_runtime

Luis Chamberlain posted 1 patch 3 years, 11 months ago
kernel/sched/rt.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] sched/rt: fix compilation on i386 for umax_rt_runtime
Posted by Luis Chamberlain 3 years, 11 months ago
On i386 you can end up with this compilation warning:

kernel/sched/rt.c:9:18: warning: 'max_rt_runtime' defined but not used [-Wunused-const-variable=]

This can happen when SYSCTL or RT_GROUP_SCHED is disabled.
Fix this.

Reported-by: kernel test robot <lkp@intel.com>
Cc: Baisong Zhong <zhongbaisong@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@bgt140507bm04>
---
 kernel/sched/rt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 8c9ed9664840..eb2a167be098 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -5,8 +5,10 @@
  */
 
 int sched_rr_timeslice = RR_TIMESLICE;
+#if defined(CONFIG_SYSCTL) || defined(CONFIG_RT_GROUP_SCHED)
 /* More than 4 hours if BW_SHIFT equals 20. */
 static const u64 max_rt_runtime = MAX_BW;
+#endif
 
 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
 
-- 
2.35.1