From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH rdma-next 17/17] IB/ipoib: Remove and fix debug prints after allocation failure
Date: Thu, 3 Nov 2016 07:02:33 +0200 [thread overview]
Message-ID: <1478149353-12125-18-git-send-email-leon@kernel.org> (raw)
In-Reply-To: <1478149353-12125-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
The prints after [k|v][m|z|c]alloc() functions are not needed,
because in case of failure, allocator will print their internal
error prints anyway.
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 12 +++---------
drivers/infiniband/ulp/ipoib/ipoib_ib.c | 5 +----
drivers/infiniband/ulp/ipoib/ipoib_main.c | 5 +----
3 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 4ad297d..375af25 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -355,11 +355,8 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i
int i;
rx->rx_ring = vzalloc(ipoib_recvq_size * sizeof *rx->rx_ring);
- if (!rx->rx_ring) {
- printk(KERN_WARNING "%s: failed to allocate CM non-SRQ ring (%d entries)\n",
- priv->ca->name, ipoib_recvq_size);
+ if (!rx->rx_ring)
return -ENOMEM;
- }
t = kmalloc(sizeof *t, GFP_KERNEL);
if (!t) {
@@ -1132,11 +1129,10 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
p->tx_ring = __vmalloc(ipoib_sendq_size * sizeof *p->tx_ring,
GFP_NOIO, PAGE_KERNEL);
- if (!p->tx_ring) {
- ipoib_warn(priv, "failed to allocate tx ring\n");
+ if (!p->tx_ring)
ret = -ENOMEM;
goto err_tx;
- }
+
memset(p->tx_ring, 0, ipoib_sendq_size * sizeof *p->tx_ring);
p->qp = ipoib_cm_create_tx_qp(p->dev, p);
@@ -1549,8 +1545,6 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
priv->cm.srq_ring = vzalloc(ipoib_recvq_size * sizeof *priv->cm.srq_ring);
if (!priv->cm.srq_ring) {
- printk(KERN_WARNING "%s: failed to allocate CM SRQ ring (%d entries)\n",
- priv->ca->name, ipoib_recvq_size);
ib_destroy_srq(priv->cm.srq);
priv->cm.srq = NULL;
return;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index be11d5d..43cf8b8a 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -418,11 +418,8 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
"(status=%d, wrid=%d vend_err %x)\n",
wc->status, wr_id, wc->vendor_err);
qp_work = kzalloc(sizeof(*qp_work), GFP_ATOMIC);
- if (!qp_work) {
- ipoib_warn(priv, "%s Failed alloc ipoib_qp_state_validate for qp: 0x%x\n",
- __func__, priv->qp->qp_num);
+ if (!qp_work)
return;
- }
INIT_WORK(&qp_work->work, ipoib_qp_state_validate_work);
qp_work->priv = priv;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 5636fc3..423b30d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1594,11 +1594,8 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
/* Allocate RX/TX "rings" to hold queued skbs */
priv->rx_ring = kzalloc(ipoib_recvq_size * sizeof *priv->rx_ring,
GFP_KERNEL);
- if (!priv->rx_ring) {
- printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n",
- ca->name, ipoib_recvq_size);
+ if (!priv->rx_ring)
goto out;
- }
priv->tx_ring = vzalloc(ipoib_sendq_size * sizeof *priv->tx_ring);
if (!priv->tx_ring) {
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-11-03 5:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 5:02 [PATCH rdma-next 00/17] Remove debug prints after allocation failure Leon Romanovsky
[not found] ` <1478149353-12125-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-03 5:02 ` [PATCH rdma-next 01/17] IB/mad: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 02/17] IB/core: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 03/17] IB/core: Release allocated memory in cache setup failure Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 04/17] IB/mlx4: Remove debug prints after allocation failure Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 05/17] IB/mlx5: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 06/17] IB/hfi1: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 07/17] IB/cxgb3: " Leon Romanovsky
[not found] ` <1478149353-12125-8-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-03 14:32 ` Steve Wise
2016-11-03 5:02 ` [PATCH rdma-next 08/17] IB/cxgb4: " Leon Romanovsky
[not found] ` <1478149353-12125-9-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-03 14:32 ` Steve Wise
2016-11-03 5:02 ` [PATCH rdma-next 09/17] IB/i40iw: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 10/17] IB/qib: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 11/17] IB/nes: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 12/17] IB/mthca: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 13/17] IB/usninc: Remove and fix " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 14/17] IB/ocrdma: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 15/17] IB/rxe: " Leon Romanovsky
2016-11-03 5:02 ` [PATCH rdma-next 16/17] IB/isert: " Leon Romanovsky
2016-11-03 5:02 ` Leon Romanovsky [this message]
2016-12-03 18:21 ` [PATCH rdma-next 00/17] Remove " Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478149353-12125-18-git-send-email-leon@kernel.org \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.