summaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-12-16 00:24:16 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-16 00:24:16 -0800
commit5e60366d56c630e32befce7ef05c569e04391ca3 (patch)
tree29e1f2ae1191d6b1741dd2bec179514c2dcab632 /lib/vsprintf.c
parent706451d47b3716c24e0553dfdefba11d202effc1 (diff)
parent36f9ff9e03de89691274a6aec45aa079bd3ae405 (diff)
Merge tag 'fallthrough-fixes-clang-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
Pull fallthrough fixes from Gustavo A. R. Silva: "Fix many fall-through warnings when building with Clang 12.0.0 using -Wimplicit-fallthrough. - powerpc: boot: include compiler_attributes.h (Nick Desaulniers) - Revert "lib: Revert use of fallthrough pseudo-keyword in lib/" (Nick Desaulniers) - powerpc: fix -Wimplicit-fallthrough (Nick Desaulniers) - lib: Fix fall-through warnings for Clang (Gustavo A. R. Silva)" * tag 'fallthrough-fixes-clang-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: lib: Fix fall-through warnings for Clang powerpc: fix -Wimplicit-fallthrough Revert "lib: Revert use of fallthrough pseudo-keyword in lib/" powerpc: boot: include compiler_attributes.h
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 14c9a6af1b23..3b53c73580c5 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1265,7 +1265,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr,
case 'R':
reversed = true;
- /* fall through */
+ fallthrough;
default:
separator = ':';
@@ -1682,7 +1682,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
switch (*(++fmt)) {
case 'L':
uc = true;
- /* fall through */
+ fallthrough;
case 'l':
index = guid_index;
break;
@@ -2219,7 +2219,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'S':
case 's':
ptr = dereference_symbol_descriptor(ptr);
- /* fall through */
+ fallthrough;
case 'B':
return symbol_string(buf, end, ptr, spec, fmt);
case 'R':
@@ -2450,7 +2450,7 @@ qualifier:
case 'x':
spec->flags |= SMALL;
- /* fall through */
+ fallthrough;
case 'X':
spec->base = 16;
@@ -2459,6 +2459,7 @@ qualifier:
case 'd':
case 'i':
spec->flags |= SIGN;
+ break;
case 'u':
break;
@@ -2468,7 +2469,7 @@ qualifier:
* utility, treat it as any other invalid or
* unsupported format specifier.
*/
- /* fall through */
+ fallthrough;
default:
WARN_ONCE(1, "Please remove unsupported %%%c in format string\n", *fmt);
@@ -3411,10 +3412,10 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
break;
case 'i':
base = 0;
- /* fall through */
+ fallthrough;
case 'd':
is_sign = true;
- /* fall through */
+ fallthrough;
case 'u':
break;
case '%':