kbuild: move -Wunused-const-variable to W=1 warning level 08/138608/2 accepted/tizen/4.0/unified/20170816.020310 accepted/tizen/unified/20170718.174249 submit/tizen/20170717.110424 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 May 2016 21:30:01 +0000 (23:30 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 17 Jul 2017 10:50:32 +0000 (10:50 +0000)
commite0dc856554b426a3cf79c297cb396941f6dcd59b
treea0afe390169743a9b409f667342f5193071692f3
parentf4ddcd874b721c15a7c35c1d662efa1841f6855e
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>
[sw0312.kim: Backport from mainline to remove GCC 6 build warnings]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I2253ee7b385704137cef252c2835842183f2ddc8
Makefile
scripts/Makefile.build