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

scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where
we are expecting to fall through.

Notice that, in this particular case, I replaced "Drop thru" and "Fall
Thru" with "fall through" annotations, which is what GCC is expecting to
find.

Also, in some cases a dash is added as a token in order to separate the
"fall through" annotation from the rest of the comment on the same line,
which is what GCC is expecting to find.

Addresses-Coverity-ID: 114979 ("Missing break in switch")
Addresses-Coverity-ID: 114980 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
5bd5f66c 12de280b

+11 -9
+11 -9
drivers/scsi/lpfc/lpfc_sli.c
··· 9408 9408 cmnd = CMD_XMIT_SEQUENCE64_CR; 9409 9409 if (phba->link_flag & LS_LOOPBACK_MODE) 9410 9410 bf_set(wqe_xo, &wqe->xmit_sequence.wge_ctl, 1); 9411 + /* fall through */ 9411 9412 case CMD_XMIT_SEQUENCE64_CR: 9412 9413 /* word3 iocb=io_tag32 wqe=reserved */ 9413 9414 wqe->xmit_sequence.rsvd3 = 0; ··· 13530 13529 case FC_STATUS_RQ_BUF_LEN_EXCEEDED: 13531 13530 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 13532 13531 "2537 Receive Frame Truncated!!\n"); 13532 + /* fall through */ 13533 13533 case FC_STATUS_RQ_SUCCESS: 13534 13534 spin_lock_irqsave(&phba->hbalock, iflags); 13535 13535 lpfc_sli4_rq_release(hrq, drq); ··· 13940 13938 case FC_STATUS_RQ_BUF_LEN_EXCEEDED: 13941 13939 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 13942 13940 "6126 Receive Frame Truncated!!\n"); 13943 - /* Drop thru */ 13941 + /* fall through */ 13944 13942 case FC_STATUS_RQ_SUCCESS: 13945 13943 spin_lock_irqsave(&phba->hbalock, iflags); 13946 13944 lpfc_sli4_rq_release(hrq, drq); ··· 14852 14850 eq->entry_count); 14853 14851 if (eq->entry_count < 256) 14854 14852 return -EINVAL; 14855 - /* otherwise default to smallest count (drop through) */ 14853 + /* fall through - otherwise default to smallest count */ 14856 14854 case 256: 14857 14855 bf_set(lpfc_eq_context_count, &eq_create->u.request.context, 14858 14856 LPFC_EQ_CNT_256); ··· 14983 14981 LPFC_CQ_CNT_WORD7); 14984 14982 break; 14985 14983 } 14986 - /* Fall Thru */ 14984 + /* fall through */ 14987 14985 default: 14988 14986 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 14989 14987 "0361 Unsupported CQ count: " ··· 14994 14992 status = -EINVAL; 14995 14993 goto out; 14996 14994 } 14997 - /* otherwise default to smallest count (drop through) */ 14995 + /* fall through - otherwise default to smallest count */ 14998 14996 case 256: 14999 14997 bf_set(lpfc_cq_context_count, &cq_create->u.request.context, 15000 14998 LPFC_CQ_CNT_256); ··· 15154 15152 LPFC_CQ_CNT_WORD7); 15155 15153 break; 15156 15154 } 15157 - /* Fall Thru */ 15155 + /* fall through */ 15158 15156 default: 15159 15157 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 15160 15158 "3118 Bad CQ count. (%d)\n", ··· 15163 15161 status = -EINVAL; 15164 15162 goto out; 15165 15163 } 15166 - /* otherwise default to smallest (drop thru) */ 15164 + /* fall through - otherwise default to smallest */ 15167 15165 case 256: 15168 15166 bf_set(lpfc_mbx_cq_create_set_cqe_cnt, 15169 15167 &cq_set->u.request, LPFC_CQ_CNT_256); ··· 15435 15433 status = -EINVAL; 15436 15434 goto out; 15437 15435 } 15438 - /* otherwise default to smallest count (drop through) */ 15436 + /* fall through - otherwise default to smallest count */ 15439 15437 case 16: 15440 15438 bf_set(lpfc_mq_context_ring_size, 15441 15439 &mq_create_ext->u.request.context, ··· 15854 15852 status = -EINVAL; 15855 15853 goto out; 15856 15854 } 15857 - /* otherwise default to smallest count (drop through) */ 15855 + /* fall through - otherwise default to smallest count */ 15858 15856 case 512: 15859 15857 bf_set(lpfc_rq_context_rqe_count, 15860 15858 &rq_create->u.request.context, ··· 15991 15989 status = -EINVAL; 15992 15990 goto out; 15993 15991 } 15994 - /* otherwise default to smallest count (drop through) */ 15992 + /* fall through - otherwise default to smallest count */ 15995 15993 case 512: 15996 15994 bf_set(lpfc_rq_context_rqe_count, 15997 15995 &rq_create->u.request.context,