summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2024-05-16 17:03:41 +0300
committerIngo Molnar <mingo@kernel.org>2024-05-17 10:22:56 +0300
commit82110ae235e0560d1f952f74f9fd991587b0e3a7 (patch)
treebbc7ce5d2bd28fc03ac52f0cec6d5cb59b022f3d /arch
parentdd0716c2b87792ebea30864e7ad1df461d4c1525 (diff)
downloadlinux-82110ae235e0560d1f952f74f9fd991587b0e3a7.tar.xz
x86/boot: Address clang -Wimplicit-fallthrough in vsprintf()
After enabling -Wimplicit-fallthrough for the x86 boot code, clang warns: arch/x86/boot/printf.c:257:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 257 | case 'u': | ^ Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning. Fixes: dd0716c2b877 ("x86/boot: Add a fallthrough annotation") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20240516-x86-boot-fix-clang-implicit-fallthrough-v1-1-04dc320ca07c@kernel.org Closes: https://lore.kernel.org/oe-kbuild-all/202405162054.ryP73vy1-lkp@intel.com/
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/boot/printf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/boot/printf.c b/arch/x86/boot/printf.c
index c0ec1dc355ab..51dc14b714f6 100644
--- a/arch/x86/boot/printf.c
+++ b/arch/x86/boot/printf.c
@@ -254,6 +254,8 @@ int vsprintf(char *buf, const char *fmt, va_list args)
case 'd':
case 'i':
flags |= SIGN;
+ break;
+
case 'u':
break;