diff options
author | Li Dongyang <dongyang.li@anu.edu.au> | 2017-08-16 23:31:23 +1000 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-22 16:48:35 -0400 |
commit | e9105cdefbf64cd7aea300f934c92051e7cb7cff (patch) | |
tree | e7a3a7f7632dd612b27848607258acfe32eeacd5 /drivers/infiniband/hw/mlx4/srq.c | |
parent | b588300801f3502a7de5ca897af68019fbb3bc79 (diff) | |
download | op-kernel-dev-e9105cdefbf64cd7aea300f934c92051e7cb7cff.zip op-kernel-dev-e9105cdefbf64cd7aea300f934c92051e7cb7cff.tar.gz |
IB/mlx4: use kvmalloc_array to allocate wrid
We could use kvmalloc_array instead of the
kmalloc and __vmalloc combination.
After this we don't need to include linux/vmalloc.h
Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/srq.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/srq.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c index 0facaf5..dd7a2fc 100644 --- a/drivers/infiniband/hw/mlx4/srq.c +++ b/drivers/infiniband/hw/mlx4/srq.c @@ -34,7 +34,6 @@ #include <linux/mlx4/qp.h> #include <linux/mlx4/srq.h> #include <linux/slab.h> -#include <linux/vmalloc.h> #include "mlx4_ib.h" #include <rdma/mlx4-abi.h> @@ -171,15 +170,11 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd, if (err) goto err_mtt; - srq->wrid = kmalloc_array(srq->msrq.max, sizeof(u64), - GFP_KERNEL | __GFP_NOWARN); + srq->wrid = kvmalloc_array(srq->msrq.max, + sizeof(u64), GFP_KERNEL); if (!srq->wrid) { - srq->wrid = __vmalloc(srq->msrq.max * sizeof(u64), - GFP_KERNEL, PAGE_KERNEL); - if (!srq->wrid) { - err = -ENOMEM; - goto err_mtt; - } + err = -ENOMEM; + goto err_mtt; } } |