[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210920183016.3a4778b5@canb.auug.org.au>
Date: Mon, 20 Sep 2021 18:30:16 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Yafang Shao <laoar.shao@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: linux-next: build warning after merge of the tip tree
Hi Yafang,
On Mon, 20 Sep 2021 14:55:29 +0800 Yafang Shao <laoar.shao@...il.com> wrote:
>
> On Mon, Sep 20, 2021 at 9:33 AM Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> >
> > Hi all,
> >
> > After merging the tip tree, today's linux-next build (powerpc_ppc64
> > defconfig) produced this warning:
> >
> > kernel/sched/debug.c: In function 'print_cfs_group_stats':
> > kernel/sched/debug.c:460:41: warning: unused variable 'stats' [-Wunused-variable]
> > 460 | struct sched_statistics *stats = __schedstats_from_se(se);
> > | ^~~~~
> >
> > Caused by commit
> >
> > cb3e971c435d ("sched: Make struct sched_statistics independent of fair sched class")
> >
> > # CONFIG_SCHEDSTATS is not set
> >
>
> Thanks for the report.
>
> We have discussed this issue before[1].
> This warning happens when CONFIG_SCHEDSTATS is not set and
> schedstat_enabled() is 0, so the whole scope should be not compiled.
> It seems that we don't need to fix this warning.
>
> [1]. https://lore.kernel.org/lkml/20210911082505.115758-1-laoar.shao@gmail.com/
Clearly it will be compiled if CONFIG_SCHEDSTATS is not set as that is
exactly what this build has ... even sections of code guarded by "if
(0)" are compiled, they may just not produce any output in the binary.
Also, I do not have W=1 for this build.
If you turned schedstat_val() into a static inline function, then this
warning would go away. That also means that argument types and return
values will be better checked.
So, please fix this.
--
Cheers,
Stephen Rothwell
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists