Skip to content

Commit

Permalink
scsi: libcxgbi: Remove unnecessary NULL checks for 'tdata' pointer
Browse files Browse the repository at this point in the history
'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>
  • Loading branch information
Varun Prakash authored and Martin K. Petersen committed Jul 25, 2020
1 parent edd7dd2 commit 61965bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/scsi/cxgbi/libcxgbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 61965bf

Please sign in to comment.