From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] net: core: Remove unnecessary alloc/OOM messages
Date: Mon, 04 Feb 2013 18:48:16 -0800 [thread overview]
Message-ID: <1360032496.4849.2.camel@joe-AO722> (raw)
In-Reply-To: <20130204.132335.1757403310770538446.davem@davemloft.net>
alloc failures already get standardized OOM
messages and a dump_stack.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/core/dev.c | 14 +++++---------
net/core/netprio_cgroup.c | 4 +---
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index a87bc74..e04bfdc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5958,10 +5958,9 @@ static int netif_alloc_rx_queues(struct net_device *dev)
BUG_ON(count < 1);
rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
- if (!rx) {
- pr_err("netdev: Unable to allocate %u rx queues\n", count);
+ if (!rx)
return -ENOMEM;
- }
+
dev->_rx = rx;
for (i = 0; i < count; i++)
@@ -5992,10 +5991,9 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
BUG_ON(count < 1);
tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
- if (!tx) {
- pr_err("netdev: Unable to allocate %u tx queues\n", count);
+ if (!tx)
return -ENOMEM;
- }
+
dev->_tx = tx;
netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL);
@@ -6482,10 +6480,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
alloc_size += NETDEV_ALIGN - 1;
p = kzalloc(alloc_size, GFP_KERNEL);
- if (!p) {
- pr_err("alloc_netdev: Unable to allocate device\n");
+ if (!p)
return NULL;
- }
dev = PTR_ALIGN(p, NETDEV_ALIGN);
dev->padded = (char *)dev - (char *)p;
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 5e67def..0777d0a 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -69,10 +69,8 @@ static int extend_netdev_table(struct net_device *dev, u32 target_idx)
/* allocate & copy */
new = kzalloc(new_sz, GFP_KERNEL);
- if (!new) {
- pr_warn("Unable to alloc new priomap!\n");
+ if (!new)
return -ENOMEM;
- }
if (old)
memcpy(new->priomap, old->priomap,
next prev parent reply other threads:[~2013-02-05 2:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 3:28 [PATCH 0/8] drivers/net: Remove unnecessary alloc/OOM messages Joe Perches
2013-02-04 3:28 ` [PATCH 1/8] caif: " Joe Perches
2013-02-04 3:28 ` [PATCH 2/8] can: " Joe Perches
2013-02-04 9:02 ` Marc Kleine-Budde
2013-02-04 3:28 ` [PATCH 4/8] drivers: net: usb: " Joe Perches
2013-02-04 3:28 ` [PATCH 5/8] wan: " Joe Perches
2013-02-10 20:30 ` Krzysztof Halasa
2013-02-04 3:28 ` [PATCH 6/8] wimax: Remove unnecessary alloc/OOM messages, alloc cleanups Joe Perches
2013-02-04 3:28 ` [PATCH 7/8] wireless: " Joe Perches
2013-02-04 3:28 ` [PATCH 8/8] drivers:net:misc: Remove unnecessary alloc/OOM messages Joe Perches
2013-02-07 4:08 ` Rusty Russell
2013-02-04 3:43 ` [PATCH 3/8] ethernet: Remove unnecessary alloc/OOM messages, alloc cleanups Joe Perches
2013-02-04 18:23 ` [PATCH 0/8] drivers/net: Remove unnecessary alloc/OOM messages David Miller
2013-02-05 2:48 ` Joe Perches [this message]
2013-02-06 20:02 ` [PATCH] net: core: " David Miller
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=1360032496.4849.2.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 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).