Skip to contentSkip to conversation

scsi: cxgb4i: remove an unnecessary NULL check for 'cconn' pointer

next Applied Varun Prakash 2 participants 2 messages Jul 14, 2020 – Jul 15, 2020 SCSI

lore
Share & tools
lore
#0 lore raw

'cconn' will never be NULL in cxgbi_conn_alloc_pdu() so remove NULL check.

---
 drivers/scsi/cxgbi/libcxgbi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/cxgbi/libcxgbi.c +1 -1
index 1fb101c..8756482 100644
@@ -1889,7 +1889,7 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op)
 	struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
 	struct cxgbi_conn *cconn = tcp_conn->dd_data;
 	struct cxgbi_device *cdev = cconn->chba->cdev;
-	struct cxgbi_sock *csk = (cconn && cconn->cep) ? cconn->cep->csk : NULL;
+	struct cxgbi_sock *csk = cconn->cep ? cconn->cep->csk : NULL;
 	struct iscsi_tcp_task *tcp_task = task->dd_data;
 	struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
 	struct scsi_cmnd *sc = task->sc;
Signature · 1 line
2.0.2
#1 lore raw
Quoted 2 lines · Varun Prakash

'cconn' will never be NULL in cxgbi_conn_alloc_pdu() so remove NULL check.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: cxgb4i: Remove an unnecessary NULL check for 'cconn' pointer

      https://git.kernel.org/mkp/scsi/c/ba8ca097089b
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering