aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/user_sdma.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-02-10 21:45:38 +0100
committerDoug Ledford <dledford@redhat.com>2017-04-20 16:25:04 -0400
commitdb6f0289f59950548ae86982ca9a84423a58401c (patch)
tree946223b4bb888b5f2396c65b2ce2a733d97b9e47 /drivers/infiniband/hw/hfi1/user_sdma.c
parentIB/hfi1: Remove intermediate var in hfi1_user_sdma_alloc_queues() (diff)
downloadlinux-dev-db6f0289f59950548ae86982ca9a84423a58401c.tar.xz
linux-dev-db6f0289f59950548ae86982ca9a84423a58401c.zip
IB/hfi1: Coding style improvement (make sizeof use safer)
Replace the specification of a data structure by a reference to the desired member as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/hfi1/user_sdma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c
index 252f0c183d61..0749689d7643 100644
--- a/drivers/infiniband/hw/hfi1/user_sdma.c
+++ b/drivers/infiniband/hw/hfi1/user_sdma.c
@@ -705,7 +705,9 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec,
/* Save all the IO vector structures */
for (i = 0; i < req->data_iovs; i++) {
INIT_LIST_HEAD(&req->iovs[i].list);
- memcpy(&req->iovs[i].iov, iovec + idx++, sizeof(struct iovec));
+ memcpy(&req->iovs[i].iov,
+ iovec + idx++,
+ sizeof(req->iovs[i].iov));
ret = pin_vector_pages(req, &req->iovs[i]);
if (ret) {
req->status = ret;