The patch titled Subject: mm: silence -Woverride-init/initializer-overrides has been added to the -mm tree. Its filename is mm-silence-woverride-init-initializer-overrides.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-silence-woverride-init-initializer-overrides.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-silence-woverride-init-initializer-overrides.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Qian Cai <cai@xxxxxx> Subject: mm: silence -Woverride-init/initializer-overrides When compiling a kernel with W=1, there are several of those warnings due to arm64 overriding a field on purpose. Just disable those warnings for both GCC and Clang of this file, so it will help dig "gems" hidden in the W=1 warnings by reducing some noises. mm/init-mm.c:39:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] INIT_MM_CONTEXT(init_mm) ^~~~~~~~~~~~~~~~~~~~~~~~ ./arch/arm64/include/asm/mmu.h:133:9: note: expanded from macro 'INIT_MM_CONTEXT' .pgd = init_pg_dir, ^~~~~~~~~~~ mm/init-mm.c:30:10: note: previous initialization is here .pgd = swapper_pg_dir, ^~~~~~~~~~~~~~ Note: there is a side project trying to support explicitly allowing specific initializer overrides in Clang, but there is no guarantee it will happen or not. https://github.com/ClangBuiltLinux/linux/issues/639 Link: http://lkml.kernel.org/r/1566920867-27453-1-git-send-email-cai@xxxxxx Signed-off-by: Qian Cai <cai@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/Makefile | 3 +++ 1 file changed, 3 insertions(+) --- a/mm/Makefile~mm-silence-woverride-init-initializer-overrides +++ a/mm/Makefile @@ -21,6 +21,9 @@ KCOV_INSTRUMENT_memcontrol.o := n KCOV_INSTRUMENT_mmzone.o := n KCOV_INSTRUMENT_vmstat.o := n +CFLAGS_init-mm.o += $(call cc-disable-warning, override-init) +CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides) + mmu-y := nommu.o mmu-$(CONFIG_MMU) := highmem.o memory.o mincore.o \ mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \ _ Patches currently in -mm which might be from cai@xxxxxx are mm-kmemleak-record-the-current-memory-pool-size.patch mm-kmemleak-increase-the-max-mem-pool-to-1m.patch mm-silence-woverride-init-initializer-overrides.patch writeback-fix-wstringop-truncation-warnings.patch