Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
f35cb48e 4fbd8d19

+3 -6
+3 -6
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 547 547 nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL; 548 548 memcpy(nopout_wqe->lun, &nopout_hdr->lun, 8); 549 549 550 - if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { 551 - u32 tmp = nopout_wqe->lun[0]; 552 - /* 57710 requires LUN field to be swapped */ 553 - nopout_wqe->lun[0] = nopout_wqe->lun[1]; 554 - nopout_wqe->lun[1] = tmp; 555 - } 550 + /* 57710 requires LUN field to be swapped */ 551 + if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) 552 + swap(nopout_wqe->lun[0], nopout_wqe->lun[1]); 556 553 557 554 nopout_wqe->itt = ((u16)task->itt | 558 555 (ISCSI_TASK_TYPE_MPATH <<