Make use of the swap macro and remove unnecessary variable tmppayload.
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 <[email protected]>
---
drivers/misc/mic/scif/scif_nodeqp.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/misc/mic/scif/scif_nodeqp.c b/drivers/misc/mic/scif/scif_nodeqp.c
index c66ca1a..e8ce4ba 100644
--- a/drivers/misc/mic/scif/scif_nodeqp.c
+++ b/drivers/misc/mic/scif/scif_nodeqp.c
@@ -467,7 +467,6 @@ static void scif_node_connect(struct scif_dev *scifdev, int dst)
struct list_head *pos, *tmp;
struct scifmsg msg;
int err;
- u64 tmppayload;
if (dst < 1 || dst > scif_info.maxid)
return;
@@ -524,9 +523,7 @@ static void scif_node_connect(struct scif_dev *scifdev, int dst)
msg.src.node = dev_i->node;
msg.dst.node = dev_j->node;
- tmppayload = msg.payload[0];
- msg.payload[0] = msg.payload[2];
- msg.payload[2] = tmppayload;
+ swap(msg.payload[0], msg.payload[2]);
msg.payload[1] = p2p_ji->ppi_da[SCIF_PPI_MMIO];
msg.payload[3] = p2p_ji->ppi_len[SCIF_PPI_APER] << PAGE_SHIFT;
--
2.7.4
From 1582963461720011016@xxx Thu Nov 02 14:06:37 +0000 2017
X-GM-THRID: 1582946126030678464
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread