Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752789AbeADKvq (ORCPT + 1 other); Thu, 4 Jan 2018 05:51:46 -0500 Received: from mout.web.de ([212.227.17.12]:55850 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbeADKvo (ORCPT ); Thu, 4 Jan 2018 05:51:44 -0500 Subject: [PATCH 1/2] mtd/maps/sun_uflash: Delete an error message for a failed memory allocation in uflash_devinit() From: SF Markus Elfring To: linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Marek Vasut , Richard Weinberger , Rob Herring Cc: LKML , kernel-janitors@vger.kernel.org References: <30c07f5a-578c-0e53-b80f-675fb24e6223@users.sourceforge.net> Message-ID: <7417f52d-ddba-e8f8-0014-31bc787213db@users.sourceforge.net> Date: Thu, 4 Jan 2018 11:51:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <30c07f5a-578c-0e53-b80f-675fb24e6223@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Fz1xCbCtCjVrWqV6R0w9pmoewI/L0O3PbNiJi0zDHnO+lzku1lk XG1TpUiBw8k96Mc3aj580GBtUCo+F/N6wP50PK8tL5/x2qKMUgHXhcgUJPfKcfGslo6xNDV CEdAyteFgWYbndcyuHv9jh+K/xxLdHXLNRfj+QC+tgepyPq9U4J30XYGx8yWRzrEqDZB5ZF qZaqwUkGDpNf56GtQc/HA== X-UI-Out-Filterresults: notjunk:1;V01:K0:YMwUdzeLzjY=:RopB/JW9602qlr2I5xarMu 1S83cunZcJqC6dcRky8mNSsvR/CWL3FSdOR5TZr1C59+vjckrorg3t2WGnzeCQL9f2hNUtZoo LSpAIQQAvSigGUG6zcez1QTl0PPOWfcVThsO8RjBHf708ILQfDqCCiNeKrfK7L+Tw9PK/KsTt HODvOX6lunyhZ6OuzE3pBOaTyHP0gaOIX+OV6iBbPE6DNkJ7xIdEky43cpiGGMuRRs3uiR57e ypw3b4pPJYJkEb0o5H1uQ57oaoe8rCLCKJr1/dGKj6MCbTErUDjlTEPK1iQ7Mex8kZz6KNMUe bSfeAxaUP5xeLA7A56dNrbJ2ppCjNyZzU9ZY22onvnfbVxfd9aVjf/duoSE69cubxdkYh2s1I nw/Wr8pJr5o+oOXIx1UlqFascCaIHl76nzDSNZLkBev4P4X8RfQSp7KqCncW6LI5IoL7BPIau /TmOmsB+g6G5XPYWEJWnv5fT2E0MJEOhWvUdcS9T3Nq8ZMmvIEd/T7179ErqMUXJyEOGXhgeZ QvxH6g/OLEzJkG0xhmh6Ja3u8FQmFtGfH7FSjkLiQ91QD1iEEAZosG1v5L7LNTcnI1GMB5Gn5 EoRzl7hQOrUdONrjENt7FLBuZb0Ej1W+gTETpPT0odqRBoan4zFOTGxLVWNJee0F8MgOTawwI RfLMxBi4NgSoEfb4l5SAEVNipxsQ4xNckYl0sZaoMfu4sk0w99Wb3FBIGLTPYuZ7MQ8Oc7geF DqTDi1pb+W7G5vtuZlXRkqkkj+zpjeNzhlCtADmzMEF/Fhf7wXWCAatFOmOzmNo5/URwrWbLJ JpizvrtNXmpfUvIjBel3HLNFYijg/zfxCjGUMGIJ0VJG7pBodQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Thu, 4 Jan 2018 10:20:14 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/mtd/maps/sun_uflash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index 1e73bba6e286..80a253cc72e2 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -62,10 +62,8 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp) } up = kzalloc(sizeof(struct uflash_dev), GFP_KERNEL); - if (!up) { - printk(KERN_ERR PFX "Cannot allocate struct uflash_dev\n"); + if (!up) return -ENOMEM; - } /* copy defaults and tweak parameters */ memcpy(&up->map, &uflash_map_templ, sizeof(uflash_map_templ)); -- 2.15.1