aboutsummaryrefslogtreecommitdiff
path: root/include/linux/cpufeature.h
diff options
context:
space:
mode:
authorAndreas Fenkart <andreas.fenkart@digitalstrom.com>2016-12-05 11:25:49 +0100
committerMoyster <oysterized@gmail.com>2018-11-30 01:14:59 +0100
commitafe0e25e7c35177aee3e73ccb29ff6cca615b3c9 (patch)
treea7f4da5e4e54f31bfce65895839bc12964319e39 /include/linux/cpufeature.h
parent60a08e969abd58cd8a46477a471bcf81c39bc5e8 (diff)
gcc6: avoid declaration of unused static struct in cpufeature.h
The lookup table is generated but not used if the driver including this header is not compiled as a module. Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
Diffstat (limited to 'include/linux/cpufeature.h')
-rw-r--r--include/linux/cpufeature.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h
index c4d4eb8ac..1ac8dac1e 100644
--- a/include/linux/cpufeature.h
+++ b/include/linux/cpufeature.h
@@ -43,10 +43,21 @@
* For a list of legal values for 'feature', please consult the file
* 'asm/cpufeature.h' of your favorite architecture.
*/
-#define module_cpu_feature_match(x, __init) \
+
+#ifdef MODULE
+
+/* gcc6 does not like unused declarations */
+#define declare_cpu_feature(x) \
static struct cpu_feature const cpu_feature_match_ ## x[] = \
{ { .feature = cpu_feature(x) }, { } }; \
-MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x); \
+MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x);
+
+#else
+#define declare_cpu_feature(x)
+#endif
+
+#define module_cpu_feature_match(x, __init) \
+declare_cpu_feature(x) \
\
static int cpu_feature_match_ ## x ## _init(void) \
{ \