From patchwork Mon Feb 4 03:28:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 217825 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 793452C007E for ; Mon, 4 Feb 2013 14:30:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754203Ab3BDDaT (ORCPT ); Sun, 3 Feb 2013 22:30:19 -0500 Received: from perches-mx.perches.com ([206.117.179.246]:58217 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754066Ab3BDDaR (ORCPT ); Sun, 3 Feb 2013 22:30:17 -0500 Received: from [173.51.221.202] (account joe@perches.com HELO localhost.localdomain) by labridge.com (CommuniGate Pro SMTP 5.0.14) with ESMTPA id 20644504; Sun, 03 Feb 2013 19:30:17 -0800 From: Joe Perches To: netdev@vger.kernel.org Cc: Joerg Reuter , Rusty Russell , "Michael S. Tsirkin" , linux-hams@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 8/8] drivers:net:misc: Remove unnecessary alloc/OOM messages Date: Sun, 3 Feb 2013 19:28:15 -0800 Message-Id: X-Mailer: git-send-email 1.8.1.2.459.gbcd45b4.dirty In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org alloc failures already get standardized OOM messages and a dump_stack. Signed-off-by: Joe Perches Acked-by: Rusty Russell (virtio_net) --- drivers/net/hamradio/dmascc.c | 7 +------ drivers/net/phy/spi_ks8995.c | 4 +--- drivers/net/virtio_net.c | 4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index ce555d9..6636022 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c @@ -463,13 +463,8 @@ static int __init setup_adapter(int card_base, int type, int n) /* Initialize what is necessary for write_scc and write_scc_data */ info = kzalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA); - if (!info) { - printk(KERN_ERR "dmascc: " - "could not allocate memory for %s at %#3x\n", - hw[type].name, card_base); + if (!info) goto out; - } - info->dev[0] = alloc_netdev(0, "", dev_setup); if (!info->dev[0]) { diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c index 41eb8ff..5c87eef 100644 --- a/drivers/net/phy/spi_ks8995.c +++ b/drivers/net/phy/spi_ks8995.c @@ -275,10 +275,8 @@ static int ks8995_probe(struct spi_device *spi) pdata = spi->dev.platform_data; ks = kzalloc(sizeof(*ks), GFP_KERNEL); - if (!ks) { - dev_err(&spi->dev, "no memory for private data\n"); + if (!ks) return -ENOMEM; - } mutex_init(&ks->lock); ks->pdata = pdata; diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index eda2042..381a2d8 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -976,10 +976,8 @@ static void virtnet_set_rx_mode(struct net_device *dev) buf = kzalloc(((uc_count + mc_count) * ETH_ALEN) + (2 * sizeof(mac_data->entries)), GFP_ATOMIC); mac_data = buf; - if (!buf) { - dev_warn(&dev->dev, "No memory for MAC address buffer\n"); + if (!buf) return; - } sg_init_table(sg, 2);