sched_ext: Fix !CONFIG_EXT_SUB_SCHED build warnings
Subsystems (2)
Tejun Heo
reviewerPATCH 1/1 sched_ext: Fix !CONFIG_EXT_SUB_SCHED build warnings
W=1 with CONFIG_EXT_SUB_SCHED=n flags 'err_msg' uninitialized and 'err_free_lb_resched' unused. Initialize err_msg and gate the label.
Signed-off-by Tejun Heo <[email protected]>
--- kernel/sched/ext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/sched/ext.c +3 -1
@@ -5584,7 +5584,7 @@ static void refresh_watchdog(void)static s32 scx_link_sched (struct scx_sched *sch) { -const char *err_msg; +const char *err_msg ="" ;s32 ret =0 ; scoped_guard(raw_spinlock_irq, &scx_sched_lock) {
@@ -6652,8 +6652,10 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops,#endif /* CONFIG_EXT_SUB_SCHED */ return sch; +#ifdef CONFIG_EXT_SUB_SCHED err_free_lb_resched:free_cpumask_var (sch->bypass_lb_resched_cpumask); +#endif err_free_lb_cpumask:free_cpumask_var (sch->bypass_lb_donee_cpumask); err_stop_helper:
Hello,
Applied to sched_ext/for-7.1-fixes.
Thanks.
--
tejun
Hi Tejun,
Quoted 4 lines · Tejun Heo
W=1 with
CONFIG_EXT_SUB_SCHED=nflags 'err_msg' uninitialized and 'err_free_lb_resched' unused. Initializeerr_msgand gate the label.Signed-off-by Tejun Heo <[email protected]>
Reviewed-by Andrea Righi <[email protected]>
Maybe add also:
Fixes d292aa00de1a ("sched_ext: Make bypass LB cpumasks per-scheduler")
Reported-by kernel test robot <[email protected]>
Thanks,
-Andrea
Quoted 28 lines
--- kernel/sched/ext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)kernel/sched/ext.c +3
-1@@ -5584,7 +5584,7 @@ static void refresh_watchdog(void)static s32 scx_link_sched (struct scx_sched *sch) { -const char *err_msg; +const char *err_msg ="" ;s32 ret =0 ; scoped_guard(raw_spinlock_irq, &scx_sched_lock) {@@ -6652,8 +6652,10 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops,#endif /* CONFIG_EXT_SUB_SCHED */ return sch; +#ifdef CONFIG_EXT_SUB_SCHED err_free_lb_resched:free_cpumask_var (sch->bypass_lb_resched_cpumask); +#endif err_free_lb_cpumask:free_cpumask_var (sch->bypass_lb_donee_cpumask); err_stop_helper: