scsi: qla2xxx: Introduce a switch/case statement in qlt_xmit_tm_rsp()
authorBart Van Assche <bvanassche@acm.org>
Tue, 27 Nov 2018 23:04:54 +0000 (15:04 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 29 Nov 2018 02:47:30 +0000 (21:47 -0500)
This patch improves code readability but does not change any functionality.

Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_target.c

index bceb8e882e7f9f827a4bfae95a0892a97405683f..510337eac1066376bc565d1e30c81d6c70b5fd8e 100644 (file)
@@ -2379,20 +2379,20 @@ void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd)
        }
 
        if (mcmd->flags == QLA24XX_MGMT_SEND_NACK) {
-               if (mcmd->orig_iocb.imm_ntfy.u.isp24.status_subcode ==
-                   ELS_LOGO ||
-                   mcmd->orig_iocb.imm_ntfy.u.isp24.status_subcode ==
-                   ELS_PRLO ||
-                   mcmd->orig_iocb.imm_ntfy.u.isp24.status_subcode ==
-                   ELS_TPRLO) {
+               switch (mcmd->orig_iocb.imm_ntfy.u.isp24.status_subcode) {
+               case ELS_LOGO:
+               case ELS_PRLO:
+               case ELS_TPRLO:
                        ql_dbg(ql_dbg_disc, vha, 0x2106,
                            "TM response logo %phC status %#x state %#x",
                            mcmd->sess->port_name, mcmd->fc_tm_rsp,
                            mcmd->flags);
                        qlt_schedule_sess_for_deletion(mcmd->sess);
-               } else {
+                       break;
+               default:
                        qlt_send_notify_ack(vha->hw->base_qpair,
                            &mcmd->orig_iocb.imm_ntfy, 0, 0, 0, 0, 0, 0);
+                       break;
                }
        } else {
                if (mcmd->orig_iocb.atio.u.raw.entry_type == ABTS_RECV_24XX) {