diff options
author | Varun Prakash <varun@chelsio.com> | 2020-07-23 17:26:31 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-07-24 22:09:56 -0400 |
commit | 61965bf6c142bae20bee2cea01b1796f1a18595a (patch) | |
tree | dac705341b49e3fffa889384308f0a568e192af0 | |
parent | edd7dd2292ab9c3628b65c4d04514c3068ad54f6 (diff) | |
download | linux-61965bf6c142bae20bee2cea01b1796f1a18595a.tar.bz2 |
scsi: libcxgbi: Remove unnecessary NULL checks for 'tdata' pointer
'tdata' pointer will never be NULL so remove NULL checks.
Link: https://lore.kernel.org/r/1595505391-3335-1-git-send-email-varun@chelsio.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 932dbd4c4cca..71aebaf533ea 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -1899,7 +1899,7 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op) u32 last_tdata_offset, last_tdata_count; int err = 0; - if (!tcp_task || !tdata) { + if (!tcp_task) { pr_err("task 0x%p, tcp_task 0x%p, tdata 0x%p.\n", task, tcp_task, tdata); return -ENOMEM; @@ -2155,7 +2155,7 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset, struct page *pg; int err; - if (!tcp_task || !tdata || tcp_task->dd_data != tdata) { + if (!tcp_task || (tcp_task->dd_data != tdata)) { pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n", task, task->sc, tcp_task, tcp_task ? tcp_task->dd_data : NULL, tdata); @@ -2371,7 +2371,7 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task) u32 datalen; int err; - if (!tcp_task || !tdata || (tcp_task->dd_data != tdata)) { + if (!tcp_task || (tcp_task->dd_data != tdata)) { pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n", task, task->sc, tcp_task, tcp_task ? tcp_task->dd_data : NULL, tdata); @@ -2472,7 +2472,7 @@ void cxgbi_cleanup_task(struct iscsi_task *task) struct iscsi_tcp_task *tcp_task = task->dd_data; struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task); - if (!tcp_task || !tdata || (tcp_task->dd_data != tdata)) { + if (!tcp_task || (tcp_task->dd_data != tdata)) { pr_info("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n", task, task->sc, tcp_task, tcp_task ? tcp_task->dd_data : NULL, tdata); |