Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f35cb48e authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Martin K. Petersen
Browse files

scsi: bnx2i: bnx2i_hwi: use swap macro in bnx2i_send_iscsi_nopout



Make use of the swap macro and remove unnecessary variable tmp.  This
makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: default avatarManish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4fbd8d19
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -547,12 +547,9 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn,
	nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL;
	nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL;
	memcpy(nopout_wqe->lun, &nopout_hdr->lun, 8);
	memcpy(nopout_wqe->lun, &nopout_hdr->lun, 8);


	if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) {
		u32 tmp = nopout_wqe->lun[0];
	/* 57710 requires LUN field to be swapped */
	/* 57710 requires LUN field to be swapped */
		nopout_wqe->lun[0] = nopout_wqe->lun[1];
	if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type))
		nopout_wqe->lun[1] = tmp;
		swap(nopout_wqe->lun[0], nopout_wqe->lun[1]);
	}


	nopout_wqe->itt = ((u16)task->itt |
	nopout_wqe->itt = ((u16)task->itt |
			   (ISCSI_TASK_TYPE_MPATH <<
			   (ISCSI_TASK_TYPE_MPATH <<