scsi: target: core: Fix fall-through warnings for Clang
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 20 Nov 2020 18:32:32 +0000 (12:32 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Dec 2020 17:59:47 +0000 (12:59 -0500)
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of
warnings by explicitly adding a break statement and a fallthrough
pseudo-keyword instead of letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Link: https://lore.kernel.org/r/761d6f755e8a6f8a6daebd1e5c1394167e5c780a.1605896059.git.gustavoars@kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_iblock.c
drivers/target/target_core_pr.c

index f2bd2e207e0b362e0d1667abde17db07f2896489..8ed93fd205c7e83c3bc7eba3bf8ce9ef85890112 100644 (file)
@@ -211,6 +211,7 @@ static unsigned long long iblock_emulate_read_cap_with_block_size(
                        break;
                case 512:
                        blocks_long <<= 3;
+                       break;
                default:
                        break;
                }
index 5f79ea05f9b815ce9ced1f7a6c670325cebf6c18..14db5e568f22b8b618e9ff69d00791123010dc56 100644 (file)
@@ -337,6 +337,7 @@ static int core_scsi3_pr_seq_non_holder(struct se_cmd *cmd, u32 pr_reg_type,
        switch (pr_reg_type) {
        case PR_TYPE_WRITE_EXCLUSIVE:
                we = 1;
+               fallthrough;
        case PR_TYPE_EXCLUSIVE_ACCESS:
                /*
                 * Some commands are only allowed for the persistent reservation