linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] sched/topology: Make compiler happy about unused constant definitions
@ 2020-08-24 15:39 Andy Shevchenko
  2020-08-24 17:09 ` Valentin Schneider
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2020-08-24 15:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Vincent Guittot, linux-kernel
  Cc: Andy Shevchenko, Valentin Schneider, Dietmar Eggemann

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.

Fixes: 4ee4ea443a5d ("sched/topology: Introduce SD metaflag for flags needing > 1 groups")
Cc: Valentin Schneider <valentin.schneider@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/sched/topology.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index 2d59ca77103e..ec440b67599c 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -27,14 +27,14 @@ enum {
 
 /* Generate a mask of SD flags with the SDF_NEEDS_GROUPS metaflag */
 #define SD_FLAG(name, mflags) (name * !!((mflags) & SDF_NEEDS_GROUPS)) |
-static const unsigned int SD_DEGENERATE_GROUPS_MASK =
+static __maybe_unused const unsigned int SD_DEGENERATE_GROUPS_MASK =
 #include <linux/sched/sd_flags.h>
 0;
 #undef SD_FLAG
 
 #ifdef CONFIG_SCHED_DEBUG
 #define SD_FLAG(_name, mflags) [__##_name] = { .meta_flags = mflags, .name = #_name },
-static const struct {
+static __maybe_unused const struct {
 	unsigned int meta_flags;
 	char *name;
 } sd_flag_debug[] = {
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-25 12:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-08-25 10:23     ` David Laight
2020-08-25 11:30       ` 'Andy Shevchenko'

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).