Commit dd0716c2 authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar

x86/boot: Add a fallthrough annotation

Add implicit fallthrough checking to the decompressor code and fix this
warning:

  arch/x86/boot/printf.c: In function ‘vsprintf’:
  arch/x86/boot/printf.c:248:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    248 |    flags |= SMALL;
        |          ^
  arch/x86/boot/printf.c:249:3: note: here
    249 |   case 'X':
        |   ^~~~

This is a patch from three years ago which I found in my trees, thus the
SUSE authorship still.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240516102240.16270-1-bp@kernel.org
parent 9776dd36
...@@ -69,6 +69,7 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP ...@@ -69,6 +69,7 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
GCOV_PROFILE := n GCOV_PROFILE := n
UBSAN_SANITIZE := n UBSAN_SANITIZE := n
......
...@@ -246,6 +246,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) ...@@ -246,6 +246,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
case 'x': case 'x':
flags |= SMALL; flags |= SMALL;
fallthrough;
case 'X': case 'X':
base = 16; base = 16;
break; break;
......
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