Skip to contentSkip to conversation

Suppress warnings when compiling fs/proc/task_mmu.c with W=1

PATCH Applied Valdis Kletnieks 1 participant 1 message Aug 1, 2016 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Suppress warnings when compiling fs/proc/task_mmu.c with W=1

Suppress a bunch of warnings of the form:

fs/proc/task_mmu.c: In function 'show_smap_vma_flags':
fs/proc/task_mmu.c:635:22: warning: initialized field overwritten [-Wt override-init]
[ilog2(VM_READ)] = "rd",

                      ^~~~

fs/proc/task_mmu.c:635:22: note: (near initialization for 'mnemonics[0]')

They happen because of the way we intentionally build the table, so silence the warning when building with 'make W=1'.

fs/proc/Makefile +1 -0
index 7151ea428041..a8c13605b434 100644
@@ -4,6 +4,7 @@
 
 obj-y   += proc.o
 
+CFLAGS_task_mmu.o	+= -Wno-override-init
 proc-y			:= nommu.o task_nommu.o
 proc-$(CONFIG_MMU)	:= task_mmu.o