From 4c1ca831adb1010e473a18eb01b3fbef7595f230 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Sun, 15 Nov 2020 20:35:31 -0800 Subject: Revert "lib: Revert use of fallthrough pseudo-keyword in lib/" This reverts commit 6a9dc5fd6170 ("lib: Revert use of fallthrough pseudo-keyword in lib/") Now that we can build arch/powerpc/boot/ free of -Wimplicit-fallthrough, re-enable these fixes for lib/. Signed-off-by: Nick Desaulniers Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Reviewed-by: Gustavo A. R. Silva Reviewed-by: Miguel Ojeda Link: https://github.com/ClangBuiltLinux/linux/issues/236 Signed-off-by: Gustavo A. R. Silva --- lib/cmdline.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/cmdline.c') diff --git a/lib/cmdline.c b/lib/cmdline.c index fbb9981a04a4..55768b4f3f58 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -132,23 +132,23 @@ unsigned long long memparse(const char *ptr, char **retptr) case 'E': case 'e': ret <<= 10; - /* fall through */ + fallthrough; case 'P': case 'p': ret <<= 10; - /* fall through */ + fallthrough; case 'T': case 't': ret <<= 10; - /* fall through */ + fallthrough; case 'G': case 'g': ret <<= 10; - /* fall through */ + fallthrough; case 'M': case 'm': ret <<= 10; - /* fall through */ + fallthrough; case 'K': case 'k': ret <<= 10; -- cgit From 36f9ff9e03de89691274a6aec45aa079bd3ae405 Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Thu, 19 Nov 2020 07:11:44 -0600 Subject: lib: Fix fall-through warnings for Clang In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case, and by replacing a number of /* fall through */ comments with the new pseudo-keyword macro fallthrough. Notice that Clang doesn't recognize /* Fall through */ comments as implicit fall-through markings. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- lib/cmdline.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/cmdline.c') diff --git a/lib/cmdline.c b/lib/cmdline.c index 55768b4f3f58..d11fdc579170 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -153,6 +153,7 @@ unsigned long long memparse(const char *ptr, char **retptr) case 'k': ret <<= 10; endptr++; + fallthrough; default: break; } -- cgit