From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Sudeep Dutt <sudeep.dutt@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] misc: mic: scif_nodeqp: use swap macro in scif_node_connect
Date: Fri, 3 Nov 2017 11:34:34 -0500 [thread overview]
Message-ID: <20171103163434.GA12906@embeddedor.com> (raw)
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 <garsilva@embeddedor.com>
---
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
reply other threads:[~2017-11-03 16:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171103163434.GA12906@embeddedor.com \
--to=garsilva@embeddedor.com \
--cc=ashutosh.dixit@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.dutt@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.