Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/xz: Add fall-through comments to a switch statement

It's good style. I was also told that GCC 7 is more strict and might
give a warning when such comments are missing.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Suggested-by: Andrei Borzenkov <arvidjaar@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Lasse Collin and committed by
Jiri Kosina
5a244f48 ff5abbe7

+16
+16
lib/xz/xz_dec_stream.c
··· 583 583 if (ret != XZ_OK) 584 584 return ret; 585 585 586 + /* Fall through */ 587 + 586 588 case SEQ_BLOCK_START: 587 589 /* We need one byte of input to continue. */ 588 590 if (b->in_pos == b->in_size) ··· 608 606 s->temp.pos = 0; 609 607 s->sequence = SEQ_BLOCK_HEADER; 610 608 609 + /* Fall through */ 610 + 611 611 case SEQ_BLOCK_HEADER: 612 612 if (!fill_temp(s, b)) 613 613 return XZ_OK; ··· 620 616 621 617 s->sequence = SEQ_BLOCK_UNCOMPRESS; 622 618 619 + /* Fall through */ 620 + 623 621 case SEQ_BLOCK_UNCOMPRESS: 624 622 ret = dec_block(s, b); 625 623 if (ret != XZ_STREAM_END) 626 624 return ret; 627 625 628 626 s->sequence = SEQ_BLOCK_PADDING; 627 + 628 + /* Fall through */ 629 629 630 630 case SEQ_BLOCK_PADDING: 631 631 /* ··· 650 642 } 651 643 652 644 s->sequence = SEQ_BLOCK_CHECK; 645 + 646 + /* Fall through */ 653 647 654 648 case SEQ_BLOCK_CHECK: 655 649 if (s->check_type == XZ_CHECK_CRC32) { ··· 675 665 676 666 s->sequence = SEQ_INDEX_PADDING; 677 667 668 + /* Fall through */ 669 + 678 670 case SEQ_INDEX_PADDING: 679 671 while ((s->index.size + (b->in_pos - s->in_start)) 680 672 & 3) { ··· 699 687 700 688 s->sequence = SEQ_INDEX_CRC32; 701 689 690 + /* Fall through */ 691 + 702 692 case SEQ_INDEX_CRC32: 703 693 ret = crc32_validate(s, b); 704 694 if (ret != XZ_STREAM_END) ··· 708 694 709 695 s->temp.size = STREAM_HEADER_SIZE; 710 696 s->sequence = SEQ_STREAM_FOOTER; 697 + 698 + /* Fall through */ 711 699 712 700 case SEQ_STREAM_FOOTER: 713 701 if (!fill_temp(s, b))