diff options
author | Alison Schofield | 2015-10-12 23:28:36 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2015-10-13 05:35:21 +0200 |
commit | 806e6e1bec9c2e7a749748f4edb2e812b6b2fdeb (patch) | |
tree | 1f34bed4e86c84e9880adad3f2fa1309757cab4f /drivers/staging/rdma/hfi1/user_sdma.c | |
parent | Staging: rdma: ipath: Use kcalloc instead of kzalloc to allocate array (diff) | |
download | kernel-qcow2-linux-806e6e1bec9c2e7a749748f4edb2e812b6b2fdeb.tar.gz kernel-qcow2-linux-806e6e1bec9c2e7a749748f4edb2e812b6b2fdeb.tar.xz kernel-qcow2-linux-806e6e1bec9c2e7a749748f4edb2e812b6b2fdeb.zip |
staging: rdma: hfi1: remove unnecessary out of memory messages
Out of memory messages are unnecssary in the drivers as they are
reported by memory management.
Addresses checkpatch.pl: WARNING: Possible unnecessary 'out of memory' message
Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma/hfi1/user_sdma.c')
-rw-r--r-- | drivers/staging/rdma/hfi1/user_sdma.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c index 368878f8e673..10ab8073d3f2 100644 --- a/drivers/staging/rdma/hfi1/user_sdma.c +++ b/drivers/staging/rdma/hfi1/user_sdma.c @@ -378,20 +378,14 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) dd = uctxt->dd; pq = kzalloc(sizeof(*pq), GFP_KERNEL); - if (!pq) { - dd_dev_err(dd, - "[%u:%u] Failed to allocate SDMA request struct\n", - uctxt->ctxt, subctxt_fp(fp)); + if (!pq) goto pq_nomem; - } + memsize = sizeof(*pq->reqs) * hfi1_sdma_comp_ring_size; pq->reqs = kmalloc(memsize, GFP_KERNEL); - if (!pq->reqs) { - dd_dev_err(dd, - "[%u:%u] Failed to allocate SDMA request queue (%u)\n", - uctxt->ctxt, subctxt_fp(fp), memsize); + if (!pq->reqs) goto pq_reqs_nomem; - } + INIT_LIST_HEAD(&pq->list); pq->dd = dd; pq->ctxt = uctxt->ctxt; @@ -417,22 +411,15 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp) } user_sdma_pkt_fp(fp) = pq; cq = kzalloc(sizeof(*cq), GFP_KERNEL); - if (!cq) { - dd_dev_err(dd, - "[%u:%u] Failed to allocate SDMA completion queue\n", - uctxt->ctxt, subctxt_fp(fp)); + if (!cq) goto cq_nomem; - } memsize = ALIGN(sizeof(*cq->comps) * hfi1_sdma_comp_ring_size, PAGE_SIZE); cq->comps = vmalloc_user(memsize); - if (!cq->comps) { - dd_dev_err(dd, - "[%u:%u] Failed to allocate SDMA completion queue entries\n", - uctxt->ctxt, subctxt_fp(fp)); + if (!cq->comps) goto cq_comps_nomem; - } + cq->nentries = hfi1_sdma_comp_ring_size; user_sdma_comp_fp(fp) = cq; |