Commit 02d93f8e authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford

IB/usninc: Remove and fix debug prints after allocation failure

This patch removes unneeded prints after allocation failure
and moves one debug print into the appropriate place.
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 870b2852
...@@ -228,8 +228,6 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp, ...@@ -228,8 +228,6 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp,
flow = usnic_fwd_alloc_flow(qp_grp->ufdev, &filter, &uaction); flow = usnic_fwd_alloc_flow(qp_grp->ufdev, &filter, &uaction);
if (IS_ERR_OR_NULL(flow)) { if (IS_ERR_OR_NULL(flow)) {
usnic_err("Unable to alloc flow failed with err %ld\n",
PTR_ERR(flow));
err = flow ? PTR_ERR(flow) : -EFAULT; err = flow ? PTR_ERR(flow) : -EFAULT;
goto out_unreserve_port; goto out_unreserve_port;
} }
...@@ -303,8 +301,6 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp, ...@@ -303,8 +301,6 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp,
flow = usnic_fwd_alloc_flow(qp_grp->ufdev, &filter, &uaction); flow = usnic_fwd_alloc_flow(qp_grp->ufdev, &filter, &uaction);
if (IS_ERR_OR_NULL(flow)) { if (IS_ERR_OR_NULL(flow)) {
usnic_err("Unable to alloc flow failed with err %ld\n",
PTR_ERR(flow));
err = flow ? PTR_ERR(flow) : -EFAULT; err = flow ? PTR_ERR(flow) : -EFAULT;
goto out_put_sock; goto out_put_sock;
} }
...@@ -694,18 +690,14 @@ usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, struct usnic_ib_vf *vf, ...@@ -694,18 +690,14 @@ usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, struct usnic_ib_vf *vf,
} }
qp_grp = kzalloc(sizeof(*qp_grp), GFP_ATOMIC); qp_grp = kzalloc(sizeof(*qp_grp), GFP_ATOMIC);
if (!qp_grp) { if (!qp_grp)
usnic_err("Unable to alloc qp_grp - Out of memory\n");
return NULL; return NULL;
}
qp_grp->res_chunk_list = alloc_res_chunk_list(vf->vnic, res_spec, qp_grp->res_chunk_list = alloc_res_chunk_list(vf->vnic, res_spec,
qp_grp); qp_grp);
if (IS_ERR_OR_NULL(qp_grp->res_chunk_list)) { if (IS_ERR_OR_NULL(qp_grp->res_chunk_list)) {
err = qp_grp->res_chunk_list ? err = qp_grp->res_chunk_list ?
PTR_ERR(qp_grp->res_chunk_list) : -ENOMEM; PTR_ERR(qp_grp->res_chunk_list) : -ENOMEM;
usnic_err("Unable to alloc res for %d with err %d\n",
qp_grp->grp_id, err);
goto out_free_qp_grp; goto out_free_qp_grp;
} }
......
...@@ -241,17 +241,12 @@ usnic_vnic_get_resources(struct usnic_vnic *vnic, enum usnic_vnic_res_type type, ...@@ -241,17 +241,12 @@ usnic_vnic_get_resources(struct usnic_vnic *vnic, enum usnic_vnic_res_type type,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
ret = kzalloc(sizeof(*ret), GFP_ATOMIC); ret = kzalloc(sizeof(*ret), GFP_ATOMIC);
if (!ret) { if (!ret)
usnic_err("Failed to allocate chunk for %s - Out of memory\n",
usnic_vnic_pci_name(vnic));
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
if (cnt > 0) { if (cnt > 0) {
ret->res = kcalloc(cnt, sizeof(*(ret->res)), GFP_ATOMIC); ret->res = kcalloc(cnt, sizeof(*(ret->res)), GFP_ATOMIC);
if (!ret->res) { if (!ret->res) {
usnic_err("Failed to allocate resources for %s. Out of memory\n",
usnic_vnic_pci_name(vnic));
kfree(ret); kfree(ret);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -311,8 +306,10 @@ static int usnic_vnic_alloc_res_chunk(struct usnic_vnic *vnic, ...@@ -311,8 +306,10 @@ static int usnic_vnic_alloc_res_chunk(struct usnic_vnic *vnic,
struct usnic_vnic_res *res; struct usnic_vnic_res *res;
cnt = vnic_dev_get_res_count(vnic->vdev, _to_vnic_res_type(type)); cnt = vnic_dev_get_res_count(vnic->vdev, _to_vnic_res_type(type));
if (cnt < 1) if (cnt < 1) {
usnic_err("Wrong res count with cnt %d\n", cnt);
return -EINVAL; return -EINVAL;
}
chunk->cnt = chunk->free_cnt = cnt; chunk->cnt = chunk->free_cnt = cnt;
chunk->res = kzalloc(sizeof(*(chunk->res))*cnt, GFP_KERNEL); chunk->res = kzalloc(sizeof(*(chunk->res))*cnt, GFP_KERNEL);
...@@ -384,12 +381,8 @@ static int usnic_vnic_discover_resources(struct pci_dev *pdev, ...@@ -384,12 +381,8 @@ static int usnic_vnic_discover_resources(struct pci_dev *pdev,
res_type < USNIC_VNIC_RES_TYPE_MAX; res_type++) { res_type < USNIC_VNIC_RES_TYPE_MAX; res_type++) {
err = usnic_vnic_alloc_res_chunk(vnic, res_type, err = usnic_vnic_alloc_res_chunk(vnic, res_type,
&vnic->chunks[res_type]); &vnic->chunks[res_type]);
if (err) { if (err)
usnic_err("Failed to alloc res %s with err %d\n",
usnic_vnic_res_type_to_str(res_type),
err);
goto out_clean_chunks; goto out_clean_chunks;
}
} }
return 0; return 0;
...@@ -454,11 +447,8 @@ struct usnic_vnic *usnic_vnic_alloc(struct pci_dev *pdev) ...@@ -454,11 +447,8 @@ struct usnic_vnic *usnic_vnic_alloc(struct pci_dev *pdev)
} }
vnic = kzalloc(sizeof(*vnic), GFP_KERNEL); vnic = kzalloc(sizeof(*vnic), GFP_KERNEL);
if (!vnic) { if (!vnic)
usnic_err("Failed to alloc vnic for %s - out of memory\n",
pci_name(pdev));
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
spin_lock_init(&vnic->res_lock); spin_lock_init(&vnic->res_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment