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 <gustavoars@kernel.org>
diff --git a/lib/cmdline.c b/lib/cmdline.c
index 55768b4..d11fdc5 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -153,6 +153,7 @@
 	case 'k':
 		ret <<= 10;
 		endptr++;
+		fallthrough;
 	default:
 		break;
 	}
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index a14ccf9..a118b0b 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -355,6 +355,7 @@
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
diff --git a/lib/nlattr.c b/lib/nlattr.c
index 74019c8..1937235 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -432,7 +432,7 @@
 			err = -EINVAL;
 			goto out_err;
 		}
-		/* fall through */
+		fallthrough;
 
 	case NLA_STRING:
 		if (attrlen < 1)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index d3c5c16..3b53c73 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -2459,6 +2459,7 @@
 	case 'd':
 	case 'i':
 		spec->flags |= SIGN;
+		break;
 	case 'u':
 		break;
 
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 67cc9b0..ee39b5e 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -396,7 +396,7 @@
             strm->adler = state->check = REVERSE(hold);
             INITBITS();
             state->mode = DICT;
-	    /* fall through */
+	    fallthrough;
         case DICT:
             if (state->havedict == 0) {
                 RESTORE();
@@ -404,10 +404,10 @@
             }
             strm->adler = state->check = zlib_adler32(0L, NULL, 0);
             state->mode = TYPE;
-	    /* fall through */
+	    fallthrough;
         case TYPE:
             if (flush == Z_BLOCK) goto inf_leave;
-	    /* fall through */
+	    fallthrough;
         case TYPEDO:
             INFLATE_TYPEDO_HOOK(strm, flush);
             if (state->last) {
@@ -446,7 +446,7 @@
             state->length = (unsigned)hold & 0xffff;
             INITBITS();
             state->mode = COPY;
-	    /* fall through */
+	    fallthrough;
         case COPY:
             copy = state->length;
             if (copy) {
@@ -480,7 +480,7 @@
 #endif
             state->have = 0;
             state->mode = LENLENS;
-	    /* fall through */
+	    fallthrough;
         case LENLENS:
             while (state->have < state->ncode) {
                 NEEDBITS(3);
@@ -501,7 +501,7 @@
             }
             state->have = 0;
             state->mode = CODELENS;
-	    /* fall through */
+	    fallthrough;
         case CODELENS:
             while (state->have < state->nlen + state->ndist) {
                 for (;;) {
@@ -575,7 +575,7 @@
                 break;
             }
             state->mode = LEN;
-	    /* fall through */
+	    fallthrough;
         case LEN:
             if (have >= 6 && left >= 258) {
                 RESTORE();
@@ -615,7 +615,7 @@
             }
             state->extra = (unsigned)(this.op) & 15;
             state->mode = LENEXT;
-	    /* fall through */
+	    fallthrough;
         case LENEXT:
             if (state->extra) {
                 NEEDBITS(state->extra);
@@ -623,7 +623,7 @@
                 DROPBITS(state->extra);
             }
             state->mode = DIST;
-	    /* fall through */
+	    fallthrough;
         case DIST:
             for (;;) {
                 this = state->distcode[BITS(state->distbits)];
@@ -649,7 +649,7 @@
             state->offset = (unsigned)this.val;
             state->extra = (unsigned)(this.op) & 15;
             state->mode = DISTEXT;
-	    /* fall through */
+	    fallthrough;
         case DISTEXT:
             if (state->extra) {
                 NEEDBITS(state->extra);
@@ -669,7 +669,7 @@
                 break;
             }
             state->mode = MATCH;
-	    /* fall through */
+	    fallthrough;
         case MATCH:
             if (left == 0) goto inf_leave;
             copy = out - left;
@@ -720,7 +720,7 @@
                 INITBITS();
             }
             state->mode = DONE;
-	    /* fall through */
+	    fallthrough;
         case DONE:
             ret = Z_STREAM_END;
             goto inf_leave;
diff --git a/lib/zstd/bitstream.h b/lib/zstd/bitstream.h
index 7c65c66..5d6343c 100644
--- a/lib/zstd/bitstream.h
+++ b/lib/zstd/bitstream.h
@@ -269,6 +269,7 @@
 		case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16;
 			fallthrough;
 		case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8;
+			fallthrough;
 		default:;
 		}
 		{
diff --git a/lib/zstd/huf_compress.c b/lib/zstd/huf_compress.c
index 08b4ae8..fd32838 100644
--- a/lib/zstd/huf_compress.c
+++ b/lib/zstd/huf_compress.c
@@ -560,6 +560,7 @@
 	case 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC);
 		fallthrough;
 	case 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC);
+		fallthrough;
 	case 0:
 	default:;
 	}