Commit f993d24a authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Heiko Carstens

s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD

Since commit 80b6093b ("kbuild: add -Wundef to KBUILD_CPPFLAGS
for W=1 builds"), building with W=1 detects misuse of #(el)if.

  $ make W=1 ARCH=s390 CROSS_COMPILE=s390x-linux-gnu-
    [snip]
  arch/s390/boot/decompressor.c:28:7: warning: "CONFIG_KERNEL_ZSTD" is not defined, evaluates to 0 [-Wundef]
     28 | #elif CONFIG_KERNEL_ZSTD
        |       ^~~~~~~~~~~~~~~~~~

This issue has been hidden because arch/s390/boot/Makefile overwrites
KBUILD_CFLAGS, dropping -Wundef.

CONFIG_KERNEL_ZSTD is a bool option. #elif defined() should be used.

The line #ifdef CONFIG_KERNEL_BZIP2 is fine, but I changed it for
consistency.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20230106161024.2373602-1-masahiroy@kernel.orgSigned-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent a494398b
......@@ -23,9 +23,9 @@
#define memmove memmove
#define memzero(s, n) memset((s), 0, (n))
#ifdef CONFIG_KERNEL_BZIP2
#if defined(CONFIG_KERNEL_BZIP2)
#define BOOT_HEAP_SIZE 0x400000
#elif CONFIG_KERNEL_ZSTD
#elif defined(CONFIG_KERNEL_ZSTD)
#define BOOT_HEAP_SIZE 0x30000
#else
#define BOOT_HEAP_SIZE 0x10000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment