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)
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);
......
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