diff mbox series

[11/14] s390/purgatory: Remove unused '-MD' and unnecessary '-c' flags

Message ID 20221228-drop-qunused-arguments-v1-11-658cbc8fc592@kernel.org (mailing list archive)
State New, archived
Headers show
Series Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS | expand

Commit Message

Nathan Chancellor Jan. 4, 2023, 7:54 p.m. UTC
When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it
warns while building objects in the purgatory folder:

  clang-16: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]

'-MMD' is always passed to the preprocessor via c_flags, even when
KBUILD_CFLAGS is overridden in a folder, so clang complains the addition
of '-MD' will be unused. Remove '-MD' to clear up this warning, as it is
unnecessary with '-MMD'.

Additionally, '-c' is also unnecessary, remove it while in the area.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: hca@linux.ibm.com
Cc: gor@linux.ibm.com
Cc: agordeev@linux.ibm.com
Cc: borntraeger@linux.ibm.com
Cc: svens@linux.ibm.com
Cc: linux-s390@vger.kernel.org
---
 arch/s390/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sven Schnelle Jan. 5, 2023, 7:33 a.m. UTC | #1
Nathan Chancellor <nathan@kernel.org> writes:

> When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it
> warns while building objects in the purgatory folder:
>
>   clang-16: error: argument unused during compilation: '-MD' [-Werror,-Wunused-command-line-argument]
>
> '-MMD' is always passed to the preprocessor via c_flags, even when
> KBUILD_CFLAGS is overridden in a folder, so clang complains the addition
> of '-MD' will be unused. Remove '-MD' to clear up this warning, as it is
> unnecessary with '-MMD'.
>
> Additionally, '-c' is also unnecessary, remove it while in the area.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
diff mbox series

Patch

diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
index d237bc6841cb..32573b4f9bd2 100644
--- a/arch/s390/purgatory/Makefile
+++ b/arch/s390/purgatory/Makefile
@@ -24,7 +24,7 @@  KCSAN_SANITIZE := n
 KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
 KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
 KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
-KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
+KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common
 KBUILD_CFLAGS += -fno-stack-protector
 KBUILD_CFLAGS += $(CLANG_FLAGS)
 KBUILD_CFLAGS += $(call cc-option,-fno-PIE)