From patchwork Thu Aug 10 15:25:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9893907 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 BD24960384 for ; Thu, 10 Aug 2017 15:26:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEDA4289A6 for ; Thu, 10 Aug 2017 15:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A21A528ADD; Thu, 10 Aug 2017 15:26:42 +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=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7250228ADC for ; Thu, 10 Aug 2017 15:26:40 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 80FE226759C; Thu, 10 Aug 2017 17:26:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9C83D26759B; Thu, 10 Aug 2017 17:26:37 +0200 (CEST) Received: from mout.web.de (mout.web.de [217.72.192.78]) by alsa0.perex.cz (Postfix) with ESMTP id F31C62665D5 for ; Thu, 10 Aug 2017 17:26:33 +0200 (CEST) Received: from [192.168.1.2] ([92.228.183.188]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MV4bp-1e7Tai3TLB-00YOzn; Thu, 10 Aug 2017 17:25:50 +0200 To: alsa-devel@alsa-project.org, Fengguang Wu , Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , Marek Vasut , Mark Brown , Takashi Iwai , Wolfram Sang From: SF Markus Elfring Message-ID: <181b6355-b6b6-eeae-d85b-9fb465d96b85@users.sourceforge.net> Date: Thu, 10 Aug 2017 17:25:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:lqSa/4IBvicD44dBeqYnWOaO9CuVw7z1j9RganStnhfV6JwzHQG orIxInCXTafd/yJLlOe5h4JxP0wvf2zJ04CA97LbE+VsbPSgeJU3nJDcMP3KAOSkNF7JGca e+fpgmXfvzmpBjTpTnuinKeW6tI0xpe36YIbmmEdsyjmC1kslCnE7lCfL4Fm59pwbTwrQjX LdQnJKq/iWVxmqycho7ww== X-UI-Out-Filterresults: notjunk:1; V01:K0:D6/vE3Acn1Q=:l2ydiCQ4doXilkiWcCNLm0 YJQ/qQkGvQbN2X2G05G6T99PzMHJ/8ciho5XPmZfJPeF0Z/v7s5Kvz7lYhqp8XXxZ7butRjqF n4sf95rExwYI5UibzMAAOCt0c8Kf9ZLZCi7K0RFAn9Zf4lUW76dWid/vLYN1eeQC4zMapM6PK 0QyQdF0qFrFJ5X4MkMcGAU7DWXnvUGPyYUq7bwkc2Vq3dHXJix0ENWF7meQ5tYvBmHMUxNDYX Omk3IfnK2rgTs4ioFVS+wqgYDBcayoaBunjzijHZTImEpcdbPHmOid0Nd20YPPfpvhyV5NdAr eymkJwsZA3fFnDWVkLLO+z1CMpoaqkSCP570QolUrepEGwP/WJDPGl2OBVR+6jr3Hv/xWlZoh KRUvOxKgktD3bC7VBMuREWGTvizsIZhPAw8yqY0HLWrdC70krrwLHdjDuSV2uBAu3lIjfZKi/ 3KYPOLv7SLw91lFoVuleod5iKGSoeWk7pDKP/sTY6rFg81XRYET+TV1sznPDvNuhYF1pJaF1U jRJ5wJl8NEg7vCEj7VGsLUlVhAC2aJjIRxD9WbJvwz+tmmvcJ4i1ArO6zQLEEH1/Fh8xozKhn K5+zgbwVL7dmn7MBgC2NuxdNSW/TlUQjR57ycSwCgk+s9T4Nday3EUlcBqJlsPeNy9Aq5UsHL ZDqLamzBDLyLQ4qM/lrNVYw3Fgq35bZGWdPNBgelkGptZOKDoHL1BONlDFdexEiFAd4Vyu9B1 /CU48AsreyyGqFYLA8fukYNO2FlzxzwUNZvsKMLUt9bHVJQ/tRfjpe/9kgCUszmsNaU3lenGd DsooiQe0yOWL7W1wPTRXqU85nc1T/bSOradxiGmBowP2LFtjiE= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH] ASoC: rsnd: Delete an error message for a failed memory allocation in three functions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 10 Aug 2017 17:13:19 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- sound/soc/sh/rcar/adg.c | 4 +--- sound/soc/sh/rcar/core.c | 4 +--- sound/soc/sh/rcar/gen.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 5b5389e5b92b..938baff86ef2 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -586,10 +586,8 @@ int rsnd_adg_probe(struct rsnd_priv *priv) int ret; adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); - if (!adg) { - dev_err(dev, "ADG allocate failed\n"); + if (!adg) return -ENOMEM; - } ret = rsnd_mod_init(priv, &adg->mod, &adg_ops, NULL, NULL, 0, 0); diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index c34562388cfa..9e331a474a21 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1402,10 +1402,8 @@ static int rsnd_probe(struct platform_device *pdev) * init priv data */ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(dev, "priv allocate failed\n"); + if (!priv) return -ENODEV; - } priv->pdev = pdev; priv->flags = (unsigned long)of_device_get_match_data(dev); diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index ee00e3516911..f04c4100043a 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -406,10 +406,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv) int ret; gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL); - if (!gen) { - dev_err(dev, "GEN allocate failed\n"); + if (!gen) return -ENOMEM; - } priv->gen = gen;