From patchwork Sun May 11 20:05:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 4152311 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2E91BFF02 for ; Sun, 11 May 2014 20:05:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF304201E7 for ; Sun, 11 May 2014 20:05:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E301B201C0 for ; Sun, 11 May 2014 20:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758373AbaEKUFv (ORCPT ); Sun, 11 May 2014 16:05:51 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:55181 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758369AbaEKUFu (ORCPT ); Sun, 11 May 2014 16:05:50 -0400 Received: by mail-la0-f46.google.com with SMTP id ec20so1298602lab.19 for ; Sun, 11 May 2014 13:05:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:cc:from:organization:date :mime-version:content-type:content-transfer-encoding:message-id; bh=dI4m9w+sfG6vMwYjiTPsPkJfIFajfs/9eBBChPo2Axs=; b=hm+j+/R3TQBlgGbAi13wxHH1Esusk3AC+Xt9/7xZwvoKjfWz3N3zYBKxSFkT5i/viV n0V86/mQw4N8Ol7sBmiQF+euImitwUFX6cSbFYjOkE5rY7wbwHklGKrPZH1Kxl4dmjXB KbYz1M7QFmoiqqbrzUo3pVgjAo0bW5ccmjI22s6CAA/HzFWxxkoQjquijeeb2KgfNiN1 3il0uWsbVcWym3miA93BhhUzLw1a//msZ1AGfZLXStcE/NMZmB9+4qUCi2unaJshQVKa GlukVw3PhqHFrn1vB1DpCnEqpsH1sT04gC/aEejhRg0pujHmnmyyuXgzwO/FryLGZInu /Aow== X-Gm-Message-State: ALoCoQnR8o3rJmz/opIgFC5F78tEoUuZ6uElHlEzF/sW1NI/x94Z7UpbdTiVHItpmn9vgm8NxzDJ X-Received: by 10.152.207.74 with SMTP id lu10mr556255lac.28.1399838748692; Sun, 11 May 2014 13:05:48 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp83-237-60-100.pppoe.mtu-net.ru. [83.237.60.100]) by mx.google.com with ESMTPSA id mk2sm9180733lbc.8.2014.05.11.13.05.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 11 May 2014 13:05:48 -0700 (PDT) To: netdev@vger.kernel.org Subject: [PATCH] sh_eth: replace devm_kzalloc() with devm_kmalloc() Cc: linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Mon, 12 May 2014 00:05:50 +0400 MIME-Version: 1.0 Message-Id: <201405120005.51199.sergei.shtylyov@cogentembedded.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When I was converting the driver to the managed device API, only devm_kzalloc() was available for memory allocation, so I had to use it, despite zeroing out PHY IRQ array right before initializing all its entries with PHY_POLL was quite stupid. Now that devm_kmalloc() has become available, we can avoid the needless zeroing out of the PHY IRQ array. Signed-off-by: Sergei Shtylyov --- This patch is against DaveM's 'net-next.git' repo. drivers/net/ethernet/renesas/sh_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -2627,7 +2627,7 @@ static int sh_mdio_init(struct sh_eth_pr pdev->name, pdev->id); /* PHY IRQ */ - mdp->mii_bus->irq = devm_kzalloc(dev, sizeof(int) * PHY_MAX_ADDR, + mdp->mii_bus->irq = devm_kmalloc(dev, sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); if (!mdp->mii_bus->irq) { ret = -ENOMEM;