Skip to content

Commit 5bd5f66

Browse files
GustavoARSilvamartinkpetersen
authored andcommitted
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>
1 parent 12de280 commit 5bd5f66

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9408,6 +9408,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
94089408
cmnd = CMD_XMIT_SEQUENCE64_CR;
94099409
if (phba->link_flag & LS_LOOPBACK_MODE)
94109410
bf_set(wqe_xo, &wqe->xmit_sequence.wge_ctl, 1);
9411+
/* fall through */
94119412
case CMD_XMIT_SEQUENCE64_CR:
94129413
/* word3 iocb=io_tag32 wqe=reserved */
94139414
wqe->xmit_sequence.rsvd3 = 0;
@@ -13529,6 +13530,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe)
1352913530
case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
1353013531
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1353113532
"2537 Receive Frame Truncated!!\n");
13533+
/* fall through */
1353213534
case FC_STATUS_RQ_SUCCESS:
1353313535
spin_lock_irqsave(&phba->hbalock, iflags);
1353413536
lpfc_sli4_rq_release(hrq, drq);
@@ -13938,7 +13940,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_hba *phba, struct lpfc_queue *cq,
1393813940
case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
1393913941
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1394013942
"6126 Receive Frame Truncated!!\n");
13941-
/* Drop thru */
13943+
/* fall through */
1394213944
case FC_STATUS_RQ_SUCCESS:
1394313945
spin_lock_irqsave(&phba->hbalock, iflags);
1394413946
lpfc_sli4_rq_release(hrq, drq);
@@ -14850,7 +14852,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
1485014852
eq->entry_count);
1485114853
if (eq->entry_count < 256)
1485214854
return -EINVAL;
14853-
/* otherwise default to smallest count (drop through) */
14855+
/* fall through - otherwise default to smallest count */
1485414856
case 256:
1485514857
bf_set(lpfc_eq_context_count, &eq_create->u.request.context,
1485614858
LPFC_EQ_CNT_256);
@@ -14981,7 +14983,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
1498114983
LPFC_CQ_CNT_WORD7);
1498214984
break;
1498314985
}
14984-
/* Fall Thru */
14986+
/* fall through */
1498514987
default:
1498614988
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1498714989
"0361 Unsupported CQ count: "
@@ -14992,7 +14994,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
1499214994
status = -EINVAL;
1499314995
goto out;
1499414996
}
14995-
/* otherwise default to smallest count (drop through) */
14997+
/* fall through - otherwise default to smallest count */
1499614998
case 256:
1499714999
bf_set(lpfc_cq_context_count, &cq_create->u.request.context,
1499815000
LPFC_CQ_CNT_256);
@@ -15152,7 +15154,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
1515215154
LPFC_CQ_CNT_WORD7);
1515315155
break;
1515415156
}
15155-
/* Fall Thru */
15157+
/* fall through */
1515615158
default:
1515715159
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1515815160
"3118 Bad CQ count. (%d)\n",
@@ -15161,7 +15163,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp,
1516115163
status = -EINVAL;
1516215164
goto out;
1516315165
}
15164-
/* otherwise default to smallest (drop thru) */
15166+
/* fall through - otherwise default to smallest */
1516515167
case 256:
1516615168
bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
1516715169
&cq_set->u.request, LPFC_CQ_CNT_256);
@@ -15433,7 +15435,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
1543315435
status = -EINVAL;
1543415436
goto out;
1543515437
}
15436-
/* otherwise default to smallest count (drop through) */
15438+
/* fall through - otherwise default to smallest count */
1543715439
case 16:
1543815440
bf_set(lpfc_mq_context_ring_size,
1543915441
&mq_create_ext->u.request.context,
@@ -15852,7 +15854,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
1585215854
status = -EINVAL;
1585315855
goto out;
1585415856
}
15855-
/* otherwise default to smallest count (drop through) */
15857+
/* fall through - otherwise default to smallest count */
1585615858
case 512:
1585715859
bf_set(lpfc_rq_context_rqe_count,
1585815860
&rq_create->u.request.context,
@@ -15989,7 +15991,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
1598915991
status = -EINVAL;
1599015992
goto out;
1599115993
}
15992-
/* otherwise default to smallest count (drop through) */
15994+
/* fall through - otherwise default to smallest count */
1599315995
case 512:
1599415996
bf_set(lpfc_rq_context_rqe_count,
1599515997
&rq_create->u.request.context,

0 commit comments

Comments
 (0)