include: jhash/signal: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, mark
switch cases where it is expected to fall through.

This patch adds four fallthrough annotations that, together, fix almost
80,000 warnings when building Linux 5.9-rc3 with Clang 12.0.0 and this[1]
change reverted. Notice that in order to enable -Wimplicit-fallthrough
for Clang, such change[1] is meant to be reverted at some point. So, this
patch helps to move in that direction.

Something important to mention is that there is currently a discrepancy
between GCC and Clang when dealing with switch fall-through to empty case
statements or to cases that only contain a break/continue/return
statement[2][3][4].

Now that the -Wimplicit-fallthrough option has been globally enabled[5],
any compiler should really warn on missing a fallthrough annotation or a
break/continue/return statement when falling through to any kind of case
statement. Otherwise, making an exception turns into a bogus sort of a
special case scenario.  Something important to keep in mind is that the
point of enabling options like -Wimplicit-fallthrough is to prevent the
human error and aid the developers in spotting bugs before their code
is even submitted/committed, therefore elimitating classes of bugs. So,
in order to really accomplish this, we should, and can, move in the
direction of addressing any error-prone scenarios and get rid of the
unintentional fallthrough bug-class in the kernel, entirely.

[1] commit e2079e93f562c ("kbuild: Do not enable -Wimplicit-fallthrough for clang for now")
[2] https://github.com/ClangBuiltLinux/linux/issues/636
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432
[4] https://godbolt.org/z/xgkvIh
[5] commit a035d552a93b ("Makefile: Globally enable fall-through warning")

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
diff --git a/include/linux/jhash.h b/include/linux/jhash.h
index cfb62e9..d30ea94 100644
--- a/include/linux/jhash.h
+++ b/include/linux/jhash.h
@@ -99,6 +99,7 @@ static inline u32 jhash(const void *key, u32 length, u32 initval)
 	case 2:  a += (u32)k[1]<<8;	fallthrough;
 	case 1:  a += k[0];
 		 __jhash_final(a, b, c);
+		 fallthrough;
 	case 0: /* Nothing left to add */
 		break;
 	}
@@ -136,6 +137,7 @@ static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
 	case 2: b += k[1];	fallthrough;
 	case 1: a += k[0];
 		__jhash_final(a, b, c);
+		fallthrough;
 	case 0:	/* Nothing left to add */
 		break;
 	}
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 7bbc0e9..a2f0166 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -238,6 +238,7 @@ static inline void siginitset(sigset_t *set, unsigned long mask)
 		memset(&set->sig[1], 0, sizeof(long)*(_NSIG_WORDS-1));
 		break;
 	case 2: set->sig[1] = 0;
+		fallthrough;
 	case 1: ;
 	}
 }
@@ -250,6 +251,7 @@ static inline void siginitsetinv(sigset_t *set, unsigned long mask)
 		memset(&set->sig[1], -1, sizeof(long)*(_NSIG_WORDS-1));
 		break;
 	case 2: set->sig[1] = -1;
+		fallthrough;
 	case 1: ;
 	}
 }