aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2018-10-30 18:05:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-31 11:54:13 -0400
commit7a20c2fa1cc6edc1c3d1d40174fc30d1bbafa4d1 (patch)
treec6f520255b1c9cc5b2d11c699147d46a0a393356 /lib
parent36c8d1e7a27f94b4d812b2a0abf106dab0fa377e (diff)
lib/zlib_inflate/inflate.c: remove fall through warnings
This patch remove all following fall through warnings by adding /* fall through */ markers. Note that we cannot add "__attribute__ ((fallthrough));" due to it is GCC7 only arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:384:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:391:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:393:16: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:430:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:556:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:595:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:602:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:627:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:646:25: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arm/boot/compressed/../../../../lib/zlib_inflate/inflate.c:696:25: warning: this statement may fall through [-Wimplicit-fallthrough=] It is easy to see that thoses fall through are needed since in each case state->mode are set to the case value just below. Link: http://lkml.kernel.org/r/1536215920-19955-1-git-send-email-clabbe@baylibre.com Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/zlib_inflate/inflate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c
index 58a733b10387..48f14cd58c77 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib_inflate/inflate.c
@@ -382,6 +382,7 @@ int zlib_inflate(z_streamp strm, int flush)
382 strm->adler = state->check = REVERSE(hold); 382 strm->adler = state->check = REVERSE(hold);
383 INITBITS(); 383 INITBITS();
384 state->mode = DICT; 384 state->mode = DICT;
385 /* fall through */
385 case DICT: 386 case DICT:
386 if (state->havedict == 0) { 387 if (state->havedict == 0) {
387 RESTORE(); 388 RESTORE();
@@ -389,8 +390,10 @@ int zlib_inflate(z_streamp strm, int flush)
389 } 390 }
390 strm->adler = state->check = zlib_adler32(0L, NULL, 0); 391 strm->adler = state->check = zlib_adler32(0L, NULL, 0);
391 state->mode = TYPE; 392 state->mode = TYPE;
393 /* fall through */
392 case TYPE: 394 case TYPE:
393 if (flush == Z_BLOCK) goto inf_leave; 395 if (flush == Z_BLOCK) goto inf_leave;
396 /* fall through */
394 case TYPEDO: 397 case TYPEDO:
395 if (state->last) { 398 if (state->last) {
396 BYTEBITS(); 399 BYTEBITS();
@@ -428,6 +431,7 @@ int zlib_inflate(z_streamp strm, int flush)
428 state->length = (unsigned)hold & 0xffff; 431 state->length = (unsigned)hold & 0xffff;
429 INITBITS(); 432 INITBITS();
430 state->mode = COPY; 433 state->mode = COPY;
434 /* fall through */
431 case COPY: 435 case COPY:
432 copy = state->length; 436 copy = state->length;
433 if (copy) { 437 if (copy) {
@@ -461,6 +465,7 @@ int zlib_inflate(z_streamp strm, int flush)
461#endif 465#endif
462 state->have = 0; 466 state->have = 0;
463 state->mode = LENLENS; 467 state->mode = LENLENS;
468 /* fall through */
464 case LENLENS: 469 case LENLENS:
465 while (state->have < state->ncode) { 470 while (state->have < state->ncode) {
466 NEEDBITS(3); 471 NEEDBITS(3);
@@ -481,6 +486,7 @@ int zlib_inflate(z_streamp strm, int flush)
481 } 486 }
482 state->have = 0; 487 state->have = 0;
483 state->mode = CODELENS; 488 state->mode = CODELENS;
489 /* fall through */
484 case CODELENS: 490 case CODELENS:
485 while (state->have < state->nlen + state->ndist) { 491 while (state->have < state->nlen + state->ndist) {
486 for (;;) { 492 for (;;) {
@@ -554,6 +560,7 @@ int zlib_inflate(z_streamp strm, int flush)
554 break; 560 break;
555 } 561 }
556 state->mode = LEN; 562 state->mode = LEN;
563 /* fall through */
557 case LEN: 564 case LEN:
558 if (have >= 6 && left >= 258) { 565 if (have >= 6 && left >= 258) {
559 RESTORE(); 566 RESTORE();
@@ -593,6 +600,7 @@ int zlib_inflate(z_streamp strm, int flush)
593 } 600 }
594 state->extra = (unsigned)(this.op) & 15; 601 state->extra = (unsigned)(this.op) & 15;
595 state->mode = LENEXT; 602 state->mode = LENEXT;
603 /* fall through */
596 case LENEXT: 604 case LENEXT:
597 if (state->extra) { 605 if (state->extra) {
598 NEEDBITS(state->extra); 606 NEEDBITS(state->extra);
@@ -600,6 +608,7 @@ int zlib_inflate(z_streamp strm, int flush)
600 DROPBITS(state->extra); 608 DROPBITS(state->extra);
601 } 609 }
602 state->mode = DIST; 610 state->mode = DIST;
611 /* fall through */
603 case DIST: 612 case DIST:
604 for (;;) { 613 for (;;) {
605 this = state->distcode[BITS(state->distbits)]; 614 this = state->distcode[BITS(state->distbits)];
@@ -625,6 +634,7 @@ int zlib_inflate(z_streamp strm, int flush)
625 state->offset = (unsigned)this.val; 634 state->offset = (unsigned)this.val;
626 state->extra = (unsigned)(this.op) & 15; 635 state->extra = (unsigned)(this.op) & 15;
627 state->mode = DISTEXT; 636 state->mode = DISTEXT;
637 /* fall through */
628 case DISTEXT: 638 case DISTEXT:
629 if (state->extra) { 639 if (state->extra) {
630 NEEDBITS(state->extra); 640 NEEDBITS(state->extra);
@@ -644,6 +654,7 @@ int zlib_inflate(z_streamp strm, int flush)
644 break; 654 break;
645 } 655 }
646 state->mode = MATCH; 656 state->mode = MATCH;
657 /* fall through */
647 case MATCH: 658 case MATCH:
648 if (left == 0) goto inf_leave; 659 if (left == 0) goto inf_leave;
649 copy = out - left; 660 copy = out - left;
@@ -694,6 +705,7 @@ int zlib_inflate(z_streamp strm, int flush)
694 INITBITS(); 705 INITBITS();
695 } 706 }
696 state->mode = DONE; 707 state->mode = DONE;
708 /* fall through */
697 case DONE: 709 case DONE:
698 ret = Z_STREAM_END; 710 ret = Z_STREAM_END;
699 goto inf_leave; 711 goto inf_leave;