diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-02-10 10:50:45 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-04-20 23:24:05 +0300 |
commit | e036c2006c77c750d0f553e1b484b029e231d7ee (patch) | |
tree | 2dd016a033c56e59133e552693b4b382706a0114 /drivers/infiniband/hw/hfi1/user_sdma.c | |
parent | 147d84e1e3a0d0920004362d3f4f6d2d24581508 (diff) | |
download | linux-e036c2006c77c750d0f553e1b484b029e231d7ee.tar.xz |
IB/hfi1: Remove intermediate var in hfi1_user_sdma_alloc_queues()
* Pass a product for a call of the function "vmalloc_user" without storing
it in an intermediate variable.
* Delete the local variable "memsize" which became unnecessary with
this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/user_sdma.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_sdma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index f00348147e3d..252f0c183d61 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -376,7 +376,6 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) { struct hfi1_filedata *fd; int ret = 0; - unsigned memsize; char buf[64]; struct hfi1_devdata *dd; struct hfi1_user_sdma_comp_q *cq; @@ -444,8 +443,8 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) if (!cq) goto cq_nomem; - memsize = PAGE_ALIGN(sizeof(*cq->comps) * hfi1_sdma_comp_ring_size); - cq->comps = vmalloc_user(memsize); + cq->comps = vmalloc_user(PAGE_ALIGN(sizeof(*cq->comps) + * hfi1_sdma_comp_ring_size)); if (!cq->comps) goto cq_comps_nomem; |