* [PATCH] s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD
@ 2023-01-06 16:10 Masahiro Yamada
2023-01-06 16:23 ` Heiko Carstens
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2023-01-06 16:10 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, linux-s390
Cc: linux-kernel, Masahiro Yamada
Since commit 80b6093b55e3 ("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: Masahiro Yamada <masahiroy@kernel.org>
---
arch/s390/boot/decompressor.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/boot/decompressor.c b/arch/s390/boot/decompressor.c
index e27c2140d620..8dcd7af2911a 100644
--- a/arch/s390/boot/decompressor.c
+++ b/arch/s390/boot/decompressor.c
@@ -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
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD
2023-01-06 16:10 [PATCH] s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD Masahiro Yamada
@ 2023-01-06 16:23 ` Heiko Carstens
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2023-01-06 16:23 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
Sven Schnelle, linux-s390, linux-kernel
On Sat, Jan 07, 2023 at 01:10:23AM +0900, Masahiro Yamada wrote:
> Since commit 80b6093b55e3 ("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: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> arch/s390/boot/decompressor.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-06 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06 16:10 [PATCH] s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD Masahiro Yamada
2023-01-06 16:23 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox