summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-05-10 23:30:01 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2017-01-26 16:06:41 +0900
commitada4531ee38f567cfa30377c60e2eda6c237322d (patch)
treec1e1698cefa040230b369cff8604f642d3ae84ad
parent764311ecece9c6e9f66ebc8b32f2229a8a77944b (diff)
downloadkernel-common-ada4531ee38f567cfa30377c60e2eda6c237322d.tar.gz
kernel-common-ada4531ee38f567cfa30377c60e2eda6c237322d.tar.bz2
kernel-common-ada4531ee38f567cfa30377c60e2eda6c237322d.zip
kbuild: move -Wunused-const-variable to W=1 warning level
gcc-6 started warning by default about variables that are not used anywhere and that are marked 'const', generating many false positives in an allmodconfig build, e.g.: arch/arm/mach-davinci/board-da830-evm.c:282:20: warning: 'da830_evm_emif25_pins' defined but not used [-Wunused-const-variable=] arch/arm/plat-omap/dmtimer.c:958:34: warning: 'omap_timer_match' defined but not used [-Wunused-const-variable=] drivers/bluetooth/hci_bcm.c:625:39: warning: 'acpi_bcm_default_gpios' defined but not used [-Wunused-const-variable=] drivers/char/hw_random/omap-rng.c:92:18: warning: 'reg_map_omap4' defined but not used [-Wunused-const-variable=] drivers/devfreq/exynos/exynos5_bus.c:381:32: warning: 'exynos5_busfreq_int_pm' defined but not used [-Wunused-const-variable=] drivers/dma/mv_xor.c:1139:34: warning: 'mv_xor_dt_ids' defined but not used [-Wunused-const-variable=] This is similar to the existing -Wunused-but-set-variable warning that was added in an earlier release and that we disable by default now and only enable when W=1 is set, so it makes sense to do the same here. Once we have eliminated the majority of the warnings for both, we can put them back into the default list. We probably want this in backport kernels as well, to allow building them with gcc-6 without introducing extra warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Lee Jones <lee.jones@linaro.org> Cc: stable@vger.kernel.org Signed-off-by: Michal Marek <mmarek@suse.com> Change-Id: Ic3f0e3744a77892350a6ee9a0a5108bfd2dd8c82
-rw-r--r--Makefile5
-rw-r--r--scripts/Makefile.build1
2 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 29a70fb11d28..f6308e4d5eef 100644
--- a/Makefile
+++ b/Makefile
@@ -622,9 +622,10 @@ endif
endif
KBUILD_CFLAGS += $(stackp-flag)
-# This warning generated too much noise in a regular build.
-# Use make W=1 to enable this warning (see scripts/Makefile.build)
+# These warnings generated too much noise in a regular build.
+# Use make W=1 to enable them (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d5d859c80729..0f45f76a2768 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -69,6 +69,7 @@ warning-1 += -Wmissing-prototypes
warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable)
+warning-1 += $(call cc-option, -Wunused-const-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
warning-2 := -Waggregate-return