linux/arch/x86/boot/compressed
Nick Desaulniers a554e740b6 x86/boot/compressed: Enable -Wundef
A discussion around -Wundef showed that there were still a few boolean
Kconfigs where #if was used rather than #ifdef to guard different code.
Kconfig doesn't define boolean configs, which can result in -Wundef
warnings.

arch/x86/boot/compressed/Makefile resets the CFLAGS used for this
directory, and doesn't re-enable -Wundef as the top level Makefile does.
If re-added, with RANDOMIZE_BASE and X86_NEED_RELOCS disabled, the
following warnings are visible.

  arch/x86/boot/compressed/misc.h:82:5: warning: 'CONFIG_RANDOMIZE_BASE'
  is not defined, evaluates to 0 [-Wundef]
      ^
  arch/x86/boot/compressed/misc.c:175:5: warning: 'CONFIG_X86_NEED_RELOCS'
  is not defined, evaluates to 0 [-Wundef]
      ^

Simply fix these and re-enable this warning for this directory.

Suggested-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210422190450.3903999-1-ndesaulniers@google.com
2021-05-12 21:39:56 +02:00
..
.gitignore
Makefile x86/boot/compressed: Enable -Wundef 2021-05-12 21:39:56 +02:00
acpi.c
cmdline.c
cpuflags.c
early_serial_console.c
efi_thunk_64.S
error.c
error.h
head_32.S
head_64.S
ident_map_64.c
idt_64.c
idt_handlers_64.S
kaslr.c
kernel_info.S
mem_encrypt.S
misc.c x86/boot/compressed: Enable -Wundef 2021-05-12 21:39:56 +02:00
misc.h x86/boot/compressed: Enable -Wundef 2021-05-12 21:39:56 +02:00
mkpiggy.c
pgtable.h
pgtable_64.c
sev.c
string.c
vmlinux.lds.S