From patchwork Fri Jan 5 20:55:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10147069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C25B60153 for ; Fri, 5 Jan 2018 20:56:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 335FF28926 for ; Fri, 5 Jan 2018 20:56:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 277C428929; Fri, 5 Jan 2018 20:56:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7CECA28926 for ; Fri, 5 Jan 2018 20:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject: From:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Gc/VE+U4gu+/073RE4plYdohT5K+FHQxFp/Tsz4B2Kk=; b=kruIW8rXPMBNOE j2TvzNDLB++Jwu9b/lYqWjXX9l9IUFiWaoT4kjP11EQsVMNx0kTu1/ckZVWkxh5aCghTbP8+r6TpC uFHPZuyXionKp6Lx0Yy2w1blNs1cFzL62rGKKaWy8Hgf7B1x5OAOuUcUWx5Dmw3ipgGl+QmxvVwwz DFsLQMT31o+/r53jeCbkRuEUFQBrrxylRtdbyxZC7W8yfw/oAg95TH29DimX/O8m/dwAnH0I0BA7m GWsbMOgN+cUaHuufeAWuQZKtwq6dyIH6cGKuRcZYuuK3OMlYe+44P2vbayVhZDd73OxDpUjzc6Bg3 f9DgvEZY/be2tYpdrlzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXZ1y-0001UP-Dd; Fri, 05 Jan 2018 20:55:58 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXZ1s-0001SA-P1; Fri, 05 Jan 2018 20:55:55 +0000 Received: from [192.168.1.3] ([78.49.23.29]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MCIe5-1eg3U40Avh-009D7g; Fri, 05 Jan 2018 21:55:33 +0100 To: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Josh Wu , Marek Vasut , Nicolas Ferre , Richard Weinberger , Wenyou Yang From: SF Markus Elfring Subject: [PATCH] mtd/nand/atmel: Delete an error message for a failed memory allocation in two functions Message-ID: <81cadb76-8c67-9289-1375-2d4a55a4adfa@users.sourceforge.net> Date: Fri, 5 Jan 2018 21:55:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:oTXKqvqMdR63rC3bOn8ghTYVB91Og51WDGu7zcKfTkHwkGU3/z4 Wj/Tz7w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cAa0kSTP2zbY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180105_125553_350188_BD5C658F X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 5 Jan 2018 21:45:04 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Wenyou Yang --- drivers/mtd/nand/atmel/nand-controller.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c index 90a71a56bc23..a41b999229c9 100644 --- a/drivers/mtd/nand/atmel/nand-controller.c +++ b/drivers/mtd/nand/atmel/nand-controller.c @@ -1612,10 +1612,8 @@ static int atmel_nand_register(struct atmel_nand *nand) mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL, "%s:nand.%d", dev_name(nc->dev), nand->cs[0].id); - if (!mtd->name) { - dev_err(nc->dev, "Failed to allocate mtd->name\n"); + if (!mtd->name) return -ENOMEM; - } } ret = nand_scan_tail(mtd); @@ -1654,10 +1652,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, nand = devm_kzalloc(nc->dev, sizeof(*nand) + (numcs * sizeof(*nand->cs)), GFP_KERNEL); - if (!nand) { - dev_err(nc->dev, "Failed to allocate NAND object\n"); + if (!nand) return ERR_PTR(-ENOMEM); - } nand->numcs = numcs;