From patchwork Thu Sep 8 16:40:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1258 Return-Path: Received: from nm9.bullet.mail.ukl.yahoo.com (nm9.bullet.mail.ukl.yahoo.com [217.146.182.250]) by open-mesh.org (Postfix) with SMTP id 6C6FE6007C9 for ; Thu, 8 Sep 2011 18:41:20 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.217] by nm9.bullet.mail.ukl.yahoo.com with NNFMP; 08 Sep 2011 16:41:20 -0000 Received: from [77.238.184.72] by tm10.bullet.mail.ukl.yahoo.com with NNFMP; 08 Sep 2011 16:41:20 -0000 Received: from [127.0.0.1] by smtp141.mail.ukl.yahoo.com with NNFMP; 08 Sep 2011 16:41:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1315500080; bh=SnOpPySpVAD/W1bLAq1zZzXATSA6zb8hwv3DQSGDH8I=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=AiccuAoqchcnMq4OAgALzZO34QYQ9r5U7jVPZTjCJUXhpGa4XlfMUKfdUmuDL3Ji6Qcjg6oplaZSKd1LOKnqZpXyV7PFntWdwd65ZZF2O2T7NV5j4+vBSHqqqJ9eY3eFvUshjNrzns+DWrfe1TaHgBL2eehu81nb1USKGiX0Dy4= X-Yahoo-Newman-Id: 184647.77896.bm@smtp141.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: En0BPpkVM1n9L7x1G2ryOcy_87qBWNyEAuhHgPdFIt_zcEI fXQOfF62RnSNeNWdhTvVippBXae8SyRDehiTvGhn.tPYe12TLR8SdmYFLOuW fcZ6lBHEtb7mHgKxFA3OxG6B8xWbK4gUSdk3qTde0jE7P4M2mAFK.AsyZpiF gzDvUlMP4owGgSoddE0t7HHA.b8XbuvN5bONUVoBHEe09GXe6YY46Vs4rGnu 6u9VZq8xLMVlqczbwVVG37QN2ZT8q7zYh2fBkUrP.jFFBXPHO9HyoMwfWBY7 .QQKB4BSc.aOr6H_ROSZxkeUe1CvgaCVCBIAiklPcmixS7fWaNj_9QLO3Yc2 gACb.uP9tWfMw6Rl.eFy.Lm.a5JX3N1r8V5sWjkpoKxyVK98- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@90.61.150.93 with plain) by smtp141.mail.ukl.yahoo.com with SMTP; 08 Sep 2011 16:41:19 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Thu, 8 Sep 2011 18:40:51 +0200 Message-Id: <1315500051-1122-8-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1315500051-1122-1-git-send-email-lindner_marek@yahoo.de> References: <1315500051-1122-1-git-send-email-lindner_marek@yahoo.de> Cc: Joe Perches , netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 7/7] batman-adv: Remove unnecessary OOM logging messages X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2011 16:41:20 -0000 From: Joe Perches 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 Signed-off-by: Marek Lindner --- 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 0cc0f04..7704df4 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -434,11 +434,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 cd7d256..0e5b772 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -492,10 +492,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); @@ -503,10 +501,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)); @@ -561,10 +557,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); @@ -582,10 +576,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 7d8332e..aceeabc 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -801,10 +801,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 +