scsi: qla2xxx: remove redundant null check on tgt
authorColin Ian King <colin.king@canonical.com>
Mon, 5 Jun 2017 17:29:58 +0000 (18:29 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Jun 2017 01:10:53 +0000 (21:10 -0400)
An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove redundant
wait when target is stopped.") removed a null check on ha->tgt.tgt_ops
and replaced it with a new check that null checked tgt, thus making the
subsequent null check on tgt totally redundant. Remove it.

Detected by CoverityScan, CID#1440452 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
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 88eea4d3448734d3e6ecdac5b9a7d19ed7185513..5aae7aa03c3879ec1c16bdc5f14aafe47c1d7b8d 100644 (file)
@@ -5521,12 +5521,6 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
        if (!tgt || tgt->tgt_stop || tgt->tgt_stopped)
                return;
 
-       if (unlikely(tgt == NULL)) {
-               ql_dbg(ql_dbg_tgt, vha, 0xe03a,
-                   "ASYNC EVENT %#x, but no tgt (ha %p)\n", code, ha);
-               return;
-       }
-
        if (((code == MBA_POINT_TO_POINT) || (code == MBA_CHG_IN_CONNECTION)) &&
            IS_QLA2100(ha))
                return;