]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IB/hfi1: Remove intermediate var in hfi1_user_sdma_alloc_queues()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 10 Feb 2017 07:50:45 +0000 (08:50 +0100)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Apr 2017 20:24:05 +0000 (16:24 -0400)
* 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>
drivers/infiniband/hw/hfi1/user_sdma.c

index f00348147e3d68aefee5009b72d6556ac4f045c1..252f0c183d61e530ca4cc77bd969ff0f5b466080 100644 (file)
@@ -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;