x86/build: Don't pass in -D__KERNEL__ multiple times
authorCao jin <caoj.fnst@cn.fujitsu.com>
Fri, 16 Mar 2018 08:49:44 +0000 (16:49 +0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 31 Mar 2018 06:02:07 +0000 (08:02 +0200)
Some .<target>.cmd files under arch/x86 are showing two instances of
-D__KERNEL__, like arch/x86/boot/ and arch/x86/realmode/rm/.

__KERNEL__ is already defined in KBUILD_CPPFLAGS in the top Makefile,
so it can be dropped safely.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kbuild@vger.kernel.org
Link: http://lkml.kernel.org/r/20180316084944.3997-1-caoj.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/Makefile
arch/x86/boot/compressed/Makefile

index d798e36d103c1955cb2db9ccb03f93bc54c30431..a517852dad559b9d6bff7b0072c36ef4d9b143ea 100644 (file)
@@ -31,8 +31,7 @@ endif
 CODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
 M16_CFLAGS      := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
 
-REALMODE_CFLAGS        := $(M16_CFLAGS) -g -Os -D__KERNEL__ \
-                  -DDISABLE_BRANCH_PROFILING \
+REALMODE_CFLAGS        := $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING \
                   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
                   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
                   -mno-mmx -mno-sse
index f25e1530e0644c83d8c69b1a90436c54ce823ae4..f484ae0ece93a28a96ebdb78ccb7ee865c039f5b 100644 (file)
@@ -26,7 +26,7 @@ KCOV_INSTRUMENT               := n
 targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
        vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
 
-KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ -O2
+KBUILD_CFLAGS := -m$(BITS) -O2
 KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
 cflags-$(CONFIG_X86_32) := -march=i386