linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	linux-kernel@vger.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: Re: [PATCH v1] sched/topology: Make compiler happy about unused constant definitions
Date: Tue, 25 Aug 2020 15:38:19 +0300	[thread overview]
Message-ID: <20200825123819.GE1891694@smile.fi.intel.com> (raw)
In-Reply-To: <jhja6yjdjg3.mognet@arm.com>

On Tue, Aug 25, 2020 at 01:00:12PM +0100, Valentin Schneider wrote:
> On 25/08/20 12:32, Andy Shevchenko wrote:
> > On Tue, Aug 25, 2020 at 02:26:05PM +0300, Andy Shevchenko wrote:
> >> On Tue, Aug 25, 2020 at 02:24:05PM +0300, Andy Shevchenko wrote:
> >> > On Tue, Aug 25, 2020 at 11:12:21AM +0100, Valentin Schneider wrote:
> >> > > On 25/08/20 10:03, Valentin Schneider wrote:
> >> > > > On 25/08/20 09:26, Andy Shevchenko wrote:
> >> > > >> On Mon, Aug 24, 2020 at 06:09:41PM +0100, Valentin Schneider wrote:
> >> > > >>> On 24/08/20 16:39, Andy Shevchenko wrote:
> >> > > >>> > Compilation of almost each file ends up with
> >> > > >>> >
> >> > > >>> >  In file included from .../include/linux/energy_model.h:10,
> >> > > >>> >                 from .../include/linux/device.h:16,
> >> > > >>> >                 from .../drivers/spi/spi.c:8:
> >> > > >>> >  .../include/linux/sched/topology.h:30:27: warning: ‘SD_DEGENERATE_GROUPS_MASK’ defined but not used [-Wunused-const-variable=]
> >> > > >>> >     30 | static const unsigned int SD_DEGENERATE_GROUPS_MASK =
> >> > > >>> >        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~
> >> > > >>> >  ...
> >> > > >>> >
> >> > > >>> > Make compiler happy by annotating the static constants with __maybwe_unused.
> >> > >
> >> > > > Sorry, that's what I get for trying to be too succinct; what I tried to say
> >> > > > was that SD_DEGENERATE_GROUPS_MASK should very much be used for SMP. If the
> >> > > > build is !SMP, it shouldn't even be defined, IOW I'm perplexed as to where
> >> > > > this is coming from.
> >> > >
> >> > > So I see how having this as a constvar rather than a constexpr is somewhat
> >> > > daft (we get an instance per compilation unit), but none of my compilers
> >> > > seem to complain (even with W=1). AFAIA the kernelbot didn't catch any of
> >> > > it either.
> >
> > And even without compiler or any other analyzer / bot I can 100% sure tell that
> > spi.c does *not* use that symbol.
> 
> Aye aye, this is a daft constvar placement from my end, apologies.
> 
> For the SD_DEGENERATE_GROUPS_MASK, that one could directly be shoved into
> kernel/sched/topology.c (or done via an enum, I don't care too much).
> 
> I suppose the other one causing you grief is sd_flag_debug[]; that one too
> really shouldn't be in a header. I need to access that in two separate
> files, so I guess I'll have to cook up some wrappers.
> 
> Let me take a jab at it, it's my own mess after all...

Thank you!
Ping me if you would need to test a patch or so.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-08-25 12:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 15:39 [PATCH v1] sched/topology: Make compiler happy about unused constant definitions Andy Shevchenko
2020-08-24 17:09 ` Valentin Schneider
2020-08-25  8:26   ` Andy Shevchenko
2020-08-25  9:03     ` Valentin Schneider
2020-08-25 10:12       ` Valentin Schneider
2020-08-25 11:24         ` Andy Shevchenko
2020-08-25 11:26           ` Andy Shevchenko
2020-08-25 11:32             ` Andy Shevchenko
2020-08-25 12:00               ` Valentin Schneider
2020-08-25 12:38                 ` Andy Shevchenko [this message]
2020-08-25 10:23     ` David Laight
2020-08-25 11:30       ` 'Andy Shevchenko'

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=20200825123819.GE1891694@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).