[PATCH 1/2] x86/boot: Add -Wunused to KBUILD_CFLAGS

From: Zhenzhong Duan
Date: Tue Mar 03 2020 - 01:52:56 EST


Compile warning option in arch/x86/boot/compressed is different from
other part of the kernel for some history reason. But "-Wunused" is
safe to be added to point out unused variable issue.

Link: https://lore.kernel.org/patchwork/patch/1175001/#1379873
Suggested-by: Borislav Petkov <bp@xxxxxxxxx>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
---
arch/x86/boot/compressed/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 26050ae0b27e..cb9743ec453a 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -37,7 +37,7 @@ KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
-KBUILD_CFLAGS += -Wno-pointer-sign
+KBUILD_CFLAGS += -Wno-pointer-sign -Wunused
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)

KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
--
2.17.1