Commit 61965bf6 authored by Varun Prakash's avatar Varun Prakash Committed by Martin K. Petersen

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.comReported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent edd7dd22
...@@ -1899,7 +1899,7 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op) ...@@ -1899,7 +1899,7 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op)
u32 last_tdata_offset, last_tdata_count; u32 last_tdata_offset, last_tdata_count;
int err = 0; int err = 0;
if (!tcp_task || !tdata) { if (!tcp_task) {
pr_err("task 0x%p, tcp_task 0x%p, tdata 0x%p.\n", pr_err("task 0x%p, tcp_task 0x%p, tdata 0x%p.\n",
task, tcp_task, tdata); task, tcp_task, tdata);
return -ENOMEM; return -ENOMEM;
...@@ -2155,7 +2155,7 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset, ...@@ -2155,7 +2155,7 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
struct page *pg; struct page *pg;
int err; 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", pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
task, task->sc, tcp_task, task, task->sc, tcp_task,
tcp_task ? tcp_task->dd_data : NULL, tdata); tcp_task ? tcp_task->dd_data : NULL, tdata);
...@@ -2371,7 +2371,7 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task) ...@@ -2371,7 +2371,7 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task)
u32 datalen; u32 datalen;
int err; 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", pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
task, task->sc, tcp_task, task, task->sc, tcp_task,
tcp_task ? tcp_task->dd_data : NULL, tdata); tcp_task ? tcp_task->dd_data : NULL, tdata);
...@@ -2472,7 +2472,7 @@ void cxgbi_cleanup_task(struct iscsi_task *task) ...@@ -2472,7 +2472,7 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
struct iscsi_tcp_task *tcp_task = task->dd_data; struct iscsi_tcp_task *tcp_task = task->dd_data;
struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task); 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", pr_info("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
task, task->sc, tcp_task, task, task->sc, tcp_task,
tcp_task ? tcp_task->dd_data : NULL, tdata); tcp_task ? tcp_task->dd_data : NULL, tdata);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment