The two mechanisms have the same effect, unify their implementation.
Also avoid spurious rebuilds when switching between the two.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
scripts/Makefile.extrawarn | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 4b4e8e136ce6b45f43dc7658eda78ae2b37bd792..1ffc7beca43bc9e373064194dc8975182815a872 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -25,8 +25,6 @@ ifneq ($(CONFIG_FRAME_WARN),0)
KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
endif
-KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror
-KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y)
KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
ifdef CONFIG_CC_IS_CLANG
@@ -214,9 +212,9 @@ KBUILD_CFLAGS += -Wno-unused-parameter
endif
#
-# W=e - error out on warnings
+# W=e and CONFIG_WERROR - error out on warnings
#
-ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),)
+ifneq ($(findstring e, $(KBUILD_EXTRA_WARN))$(CONFIG_WERROR),)
KBUILD_CPPFLAGS += -Werror
--
2.50.1