[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200824153902.57875-1-andriy.shevchenko@linux.intel.com>
Date: Mon, 24 Aug 2020 18:39:02 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Valentin Schneider <valentin.schneider@....com>,
Dietmar Eggemann <dietmar.eggemann@....com>
Subject: [PATCH v1] sched/topology: Make compiler happy about unused constant definitions
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@....com>
Cc: Dietmar Eggemann <dietmar.eggemann@....com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.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
Powered by blists - more mailing lists