All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Marek Lindner <lindner_marek@yahoo.de>,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages
Date: Mon, 29 Aug 2011 14:17:24 -0700	[thread overview]
Message-ID: <c469b9fb57fb75547e3e9092ebfdb3a79480b28f.1314650069.git.joe@perches.com> (raw)
In-Reply-To: <cover.1314650069.git.joe@perches.com>

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/batman-adv/hard-interface.c |    5 +----
 net/batman-adv/main.c           |    2 --
 net/batman-adv/originator.c     |   16 ++++------------
 net/batman-adv/soft-interface.c |    4 +---
 net/batman-adv/vis.c            |    4 +---
 5 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bf91e4d..6a5312e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -455,11 +455,8 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
 	dev_hold(net_dev);
 
 	hard_iface = kmalloc(sizeof(*hard_iface), GFP_ATOMIC);
-	if (!hard_iface) {
-		pr_err("Can't add interface (%s): out of memory\n",
-		       net_dev->name);
+	if (!hard_iface)
 		goto release_dev;
-	}
 
 	ret = sysfs_add_hardif(&hard_iface->hardif_obj, net_dev);
 	if (ret)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 79b9ae5..fb87bdc 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -117,8 +117,6 @@ int mesh_init(struct net_device *soft_iface)
 	goto end;
 
 err:
-	pr_err("Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
 	mesh_free(soft_iface);
 	return -1;
 
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index d448018..6e558cd 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -493,10 +493,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(unsigned long) * NUM_WORDS,
 			   GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own,
 	       (max_if_num - 1) * sizeof(unsigned long) * NUM_WORDS);
@@ -504,10 +502,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	orig_node->bcast_own = data_ptr;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       (max_if_num - 1) * sizeof(uint8_t));
@@ -562,10 +558,8 @@ static int orig_node_del_if(struct orig_node *orig_node,
 
 	chunk_size = sizeof(unsigned long) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	/* copy first part */
 	memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
@@ -583,10 +577,8 @@ free_bcast_own:
 		goto free_own_sum;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       del_if_num * sizeof(uint8_t));
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 402fd96..9b5e69e 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -800,10 +800,8 @@ struct net_device *softif_create(const char *name)
 
 	soft_iface = alloc_netdev(sizeof(*bat_priv), name, interface_setup);
 
-	if (!soft_iface) {
-		pr_err("Unable to allocate the batman interface: %s\n", name);
+	if (!soft_iface)
 		goto out;
-	}
 
 	ret = register_netdevice(soft_iface);
 	if (ret < 0) {
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index fb9b19f..f81a6b6 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -887,10 +887,8 @@ int vis_init(struct bat_priv *bat_priv)
 	}
 
 	bat_priv->my_vis_info = kmalloc(MAX_VIS_PACKET_SIZE, GFP_ATOMIC);
-	if (!bat_priv->my_vis_info) {
-		pr_err("Can't initialize vis packet\n");
+	if (!bat_priv->my_vis_info)
 		goto err;
-	}
 
 	bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) +
 							  MAX_VIS_PACKET_SIZE +
-- 
1.7.6.405.gc1be0


WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Marek Lindner <lindner_marek@yahoo.de>,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	"David S. Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: [B.A.T.M.A.N.] [PATCH 05/24] batman-adv: Remove unnecessary OOM logging messages
Date: Mon, 29 Aug 2011 14:17:24 -0700	[thread overview]
Message-ID: <c469b9fb57fb75547e3e9092ebfdb3a79480b28f.1314650069.git.joe@perches.com> (raw)
In-Reply-To: <cover.1314650069.git.joe@perches.com>

Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/batman-adv/hard-interface.c |    5 +----
 net/batman-adv/main.c           |    2 --
 net/batman-adv/originator.c     |   16 ++++------------
 net/batman-adv/soft-interface.c |    4 +---
 net/batman-adv/vis.c            |    4 +---
 5 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bf91e4d..6a5312e 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -455,11 +455,8 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
 	dev_hold(net_dev);
 
 	hard_iface = kmalloc(sizeof(*hard_iface), GFP_ATOMIC);
-	if (!hard_iface) {
-		pr_err("Can't add interface (%s): out of memory\n",
-		       net_dev->name);
+	if (!hard_iface)
 		goto release_dev;
-	}
 
 	ret = sysfs_add_hardif(&hard_iface->hardif_obj, net_dev);
 	if (ret)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 79b9ae5..fb87bdc 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -117,8 +117,6 @@ int mesh_init(struct net_device *soft_iface)
 	goto end;
 
 err:
-	pr_err("Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
 	mesh_free(soft_iface);
 	return -1;
 
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index d448018..6e558cd 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -493,10 +493,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(unsigned long) * NUM_WORDS,
 			   GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own,
 	       (max_if_num - 1) * sizeof(unsigned long) * NUM_WORDS);
@@ -504,10 +502,8 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	orig_node->bcast_own = data_ptr;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       (max_if_num - 1) * sizeof(uint8_t));
@@ -562,10 +558,8 @@ static int orig_node_del_if(struct orig_node *orig_node,
 
 	chunk_size = sizeof(unsigned long) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	/* copy first part */
 	memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
@@ -583,10 +577,8 @@ free_bcast_own:
 		goto free_own_sum;
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
-	if (!data_ptr) {
-		pr_err("Can't resize orig: out of memory\n");
+	if (!data_ptr)
 		return -1;
-	}
 
 	memcpy(data_ptr, orig_node->bcast_own_sum,
 	       del_if_num * sizeof(uint8_t));
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 402fd96..9b5e69e 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -800,10 +800,8 @@ struct net_device *softif_create(const char *name)
 
 	soft_iface = alloc_netdev(sizeof(*bat_priv), name, interface_setup);
 
-	if (!soft_iface) {
-		pr_err("Unable to allocate the batman interface: %s\n", name);
+	if (!soft_iface)
 		goto out;
-	}
 
 	ret = register_netdevice(soft_iface);
 	if (ret < 0) {
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index fb9b19f..f81a6b6 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -887,10 +887,8 @@ int vis_init(struct bat_priv *bat_priv)
 	}
 
 	bat_priv->my_vis_info = kmalloc(MAX_VIS_PACKET_SIZE, GFP_ATOMIC);
-	if (!bat_priv->my_vis_info) {
-		pr_err("Can't initialize vis packet\n");
+	if (!bat_priv->my_vis_info)
 		goto err;
-	}
 
 	bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) +
 							  MAX_VIS_PACKET_SIZE +
-- 
1.7.6.405.gc1be0


  parent reply	other threads:[~2011-08-29 21:19 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 21:17 [PATCH 00/24] net: Remove unnecessary OOM logging messages Joe Perches
2011-08-29 21:17 ` [Bridge] " Joe Perches
2011-08-29 21:17 ` [B.A.T.M.A.N.] " Joe Perches
2011-08-29 21:17 ` Joe Perches
2011-08-29 21:17 ` Joe Perches
2011-08-29 21:17 ` [PATCH 01/24] 802: " Joe Perches
2011-08-29 21:17 ` [PATCH 02/24] 9p: " Joe Perches
2011-08-29 21:17 ` [PATCH 03/24] atm: " Joe Perches
2011-08-29 21:17 ` [PATCH 04/24] ax25: " Joe Perches
2011-08-29 22:42   ` Joerg Reuter
2011-08-29 21:17 ` Joe Perches [this message]
2011-08-29 21:17   ` [B.A.T.M.A.N.] [PATCH 05/24] batman-adv: " Joe Perches
2011-08-30 10:58   ` Marek Lindner
2011-08-30 10:58     ` Marek Lindner
2011-08-30 10:58     ` Marek Lindner
2011-08-29 21:17 ` [PATCH 06/24] netfilter: " Joe Perches
2011-08-29 21:17   ` [Bridge] " Joe Perches
2011-08-30 12:46   ` Patrick McHardy
2011-08-30 12:46     ` [Bridge] " Patrick McHardy
2011-08-30 16:13     ` Joe Perches
2011-08-30 16:13       ` [Bridge] " Joe Perches
2011-08-30 17:55     ` David Miller
2011-08-30 17:55       ` [Bridge] " David Miller
2011-08-31 10:13       ` Patrick McHardy
2011-08-31 10:13         ` [Bridge] " Patrick McHardy
2011-10-11  0:15         ` Pablo Neira Ayuso
2011-08-29 21:17 ` [PATCH 07/24] can: " Joe Perches
2011-08-31 17:11   ` Oliver Hartkopp
2011-08-29 21:17 ` [PATCH 08/24] ceph: " Joe Perches
2011-08-29 21:17 ` [PATCH 09/24] decnet: " Joe Perches
2011-08-29 21:17 ` [PATCH 10/24] econet: " Joe Perches
2011-08-29 21:17 ` [PATCH 11/24] iucv: " Joe Perches
2011-08-29 21:17 ` [PATCH 12/24] mac80211: " Joe Perches
2011-08-29 21:17 ` [PATCH 13/24] netrom: " Joe Perches
2011-08-29 21:17 ` [PATCH 14/24] rds: " Joe Perches
2011-08-29 21:17 ` [PATCH 15/24] rfkill: " Joe Perches
2011-08-29 21:17 ` [PATCH 16/24] rose: " Joe Perches
2011-08-29 21:17 ` [PATCH 17/24] sched: " Joe Perches
2011-08-30 22:27   ` jamal
2011-08-29 21:17 ` [PATCH 18/24] sctp: " Joe Perches
2011-08-29 21:17   ` Joe Perches
2011-08-29 21:29   ` Vladislav Yasevich
2011-08-29 21:29     ` Vladislav Yasevich
2011-08-29 21:43   ` Eric Dumazet
2011-08-29 21:43     ` Eric Dumazet
2011-08-29 21:51     ` Eric Dumazet
2011-08-29 21:51       ` Eric Dumazet
2011-08-29 22:15       ` David Miller
2011-08-29 22:15         ` David Miller
2011-09-01  0:25         ` Joe Perches
2011-09-01  0:25           ` Joe Perches
2011-08-30  1:21     ` Joe Perches
2011-08-30  1:21       ` Joe Perches
2011-08-29 21:17 ` [PATCH 19/24] sunrpc: " Joe Perches
2011-08-29 21:36   ` Myklebust, Trond
2011-08-29 21:37     ` David Miller
2011-08-29 21:54       ` Boaz Harrosh
2011-08-29 21:54         ` Boaz Harrosh
2011-08-29 22:03         ` David Miller
2011-08-29 22:03           ` David Miller
2011-08-29 23:25           ` Myklebust, Trond
2011-08-29 23:33             ` Boaz Harrosh
2011-08-29 23:33               ` Boaz Harrosh
2011-08-30  2:35             ` David Miller
2011-08-30  2:35               ` David Miller
2011-08-29 22:08         ` Myklebust, Trond
2011-08-29 22:08           ` Myklebust, Trond
2011-08-29 22:08           ` Myklebust, Trond
2011-08-29 21:17 ` [PATCH 20/24] tipc: " Joe Perches
2011-08-29 21:17 ` [PATCH 21/24] wanrouter: " Joe Perches
2011-08-29 21:17 ` [PATCH 22/24] wireless: " Joe Perches
2011-08-29 21:17 ` [PATCH 23/24] x25: " Joe Perches
2011-08-29 21:17 ` [PATCH 24/24] net: " Joe Perches

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=c469b9fb57fb75547e3e9092ebfdb3a79480b28f.1314650069.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=lindner_marek@yahoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=siwu@hrz.tu-chemnitz.de \
    /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.