netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] mlx5_core: warn if no space left in alloc_4k()
@ 2013-11-01 10:20 Dan Carpenter
       [not found] ` <20131101102044.GB29795-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2013-11-01 10:20 UTC (permalink / raw)
  To: Eli Cohen
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

The warning was unreachable.  In the original code, it would print the
line number and the function but I have added an error message.

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
I haven't tested this, hopefully the warning is not annoying.

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
index ba816c2..cb86265 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
@@ -193,8 +193,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)
 	unsigned n;
 
 	if (list_empty(&dev->priv.free_list)) {
+		mlx5_core_warn(dev, "no available space\n");
 		return -ENOMEM;
-		mlx5_core_warn(dev, "\n");
 	}
 
 	fp = list_entry(dev->priv.free_list.next, struct fw_page, list);
--
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-05 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 10:20 [patch -next] mlx5_core: warn if no space left in alloc_4k() Dan Carpenter
     [not found] ` <20131101102044.GB29795-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>
2013-11-03  7:03   ` Eli Cohen
2013-11-03 23:16     ` Dan Carpenter
2013-11-04 22:20     ` [patch v2] mlx5_core: delete some dead code Dan Carpenter
2013-11-05 20:51       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).