scsi: ibmvfc: Mark expected switch fall-throughs
Subsystems (3)
PATCH 1/1 scsi: ibmvfc: Mark expected switch fall-throughs
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings:
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_npiv_login_done':drivers/scsi/ibmvscsi/ibmvfc.c:4022:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
ibmvfc_retry_host_init(vhost);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/scsi/ibmvscsi/ibmvfc.c:4023:2: note: here
case IBMVFC_MAD_DRIVER_FAILED:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_bsg_request':drivers/scsi/ibmvscsi/ibmvfc.c:1830:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id = (bsg_request->rqst_data.h_els.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(bsg_request->rqst_data.h_els.port_id[1] << 8) |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bsg_request->rqst_data.h_els.port_id[2];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/scsi/ibmvscsi/ibmvfc.c:1833:2: note: here
case FC_BSG_RPT_ELS:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c:1838:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id = (bsg_request->rqst_data.h_ct.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(bsg_request->rqst_data.h_ct.port_id[1] << 8) |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bsg_request->rqst_data.h_ct.port_id[2];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/scsi/ibmvscsi/ibmvfc.c:1841:2: note: here
case FC_BSG_RPT_CT:
^~~~
--- drivers/scsi/ibmvscsi/ibmvfc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/ibmvscsi/ibmvfc.c +3 -0
@@ -1830,6 +1830,7 @@ static int ibmvfc_bsg_request(struct bsg_job *job) port_id = (bsg_request->rqst_data.h_els.port_id[0 ] <<16 ) | (bsg_request->rqst_data.h_els.port_id[1 ] <<8 ) | bsg_request->rqst_data.h_els.port_id[2 ]; +/* fall through */ case FC_BSG_RPT_ELS : fc_flags =IBMVFC_FC_ELS ;break ;
@@ -1838,6 +1839,7 @@ static int ibmvfc_bsg_request(struct bsg_job *job) port_id = (bsg_request->rqst_data.h_ct.port_id[0 ] <<16 ) | (bsg_request->rqst_data.h_ct.port_id[1 ] <<8 ) | bsg_request->rqst_data.h_ct.port_id[2 ]; +/* fall through */ case FC_BSG_RPT_CT : fc_flags =IBMVFC_FC_CT_IU ;break ;
@@ -4020,6 +4022,7 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)return ;case IBMVFC_MAD_CRQ_ERROR :ibmvfc_retry_host_init (vhost); +/* fall through */ case IBMVFC_MAD_DRIVER_FAILED :ibmvfc_free_event (evt);return ;
Signature · 1 line
2.22.0
Quoted 29 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings:
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_npiv_login_done':drivers/scsi/ibmvscsi/ibmvfc.c:4022:3: warning: this statement may fall through [-Wimplicit-fallthrough=]ibmvfc_retry_host_init(vhost); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c:4023:2: note: here
caseIBMVFC_MAD_DRIVER_FAILED:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_bsg_request':drivers/scsi/ibmvscsi/ibmvfc.c:1830:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id= (bsg_request->rqst_data.h_els.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(bsg_request->rqst_data.h_els.port_id[1] << 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bsg_request->rqst_data.h_els.port_id[2]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c:1833:2: note: here
caseFC_BSG_RPT_ELS:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c:1838:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id= (bsg_request->rqst_data.h_ct.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(bsg_request->rqst_data.h_ct.port_id[1] << 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bsg_request->rqst_data.h_ct.port_id[2]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
drivers/scsi/ibmvscsi/ibmvfc.c:1841:2: note: here
caseFC_BSG_RPT_CT:
^~~~Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 35 lines
--- drivers/scsi/ibmvscsi/ibmvfc.c | 3 +++ 1 file changed, 3 insertions(+)drivers/scsi/ibmvscsi/ibmvfc.c +3
-0@@ -1830,6 +1830,7 @@ static int ibmvfc_bsg_request(struct bsg_job *job) port_id = (bsg_request->rqst_data.h_els.port_id[0 ] <<16 ) | (bsg_request->rqst_data.h_els.port_id[1 ] <<8 ) | bsg_request->rqst_data.h_els.port_id[2 ]; +/* fall through */ case FC_BSG_RPT_ELS : fc_flags =IBMVFC_FC_ELS ;break ;@@ -1838,6 +1839,7 @@ static int ibmvfc_bsg_request(struct bsg_job *job) port_id = (bsg_request->rqst_data.h_ct.port_id[0 ] <<16 ) | (bsg_request->rqst_data.h_ct.port_id[1 ] <<8 ) | bsg_request->rqst_data.h_ct.port_id[2 ]; +/* fall through */ case FC_BSG_RPT_CT : fc_flags =IBMVFC_FC_CT_IU ;break ;@@ -4020,6 +4022,7 @@ static void ibmvfc_npiv_login_done(struct ibmvfc_event *evt)return ;case IBMVFC_MAD_CRQ_ERROR :ibmvfc_retry_host_init (vhost); +/* fall through */ case IBMVFC_MAD_DRIVER_FAILED :ibmvfc_free_event (evt);return ;Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
Quoted 29 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings:
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_npiv_login_done':drivers/scsi/ibmvscsi/ibmvfc.c:4022:3: warning: this statement may fall through [-Wimplicit-fallthrough=]ibmvfc_retry_host_init(vhost); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c:4023:2: note: here
caseIBMVFC_MAD_DRIVER_FAILED:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_bsg_request':drivers/scsi/ibmvscsi/ibmvfc.c:1830:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id= (bsg_request->rqst_data.h_els.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(bsg_request->rqst_data.h_els.port_id[1] << 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bsg_request->rqst_data.h_els.port_id[2]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c:1833:2: note: here
caseFC_BSG_RPT_ELS:
^~~~drivers/scsi/ibmvscsi/ibmvfc.c:1838:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_id= (bsg_request->rqst_data.h_ct.port_id[0] << 16) | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(bsg_request->rqst_data.h_ct.port_id[1] << 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bsg_request->rqst_data.h_ct.port_id[2]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
drivers/scsi/ibmvscsi/ibmvfc.c:1841:2: note: here
caseFC_BSG_RPT_CT:
^~~~Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>---
Martin K. Petersen
AppliedGustavo,
Quoted 1 line
Mark switch cases where we are expecting to fall through.
Applied to 5.4/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering