From patchwork Fri Aug 11 14:12:19 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: 9896031 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 A010B60325 for ; Fri, 11 Aug 2017 14:13:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 921E4285D2 for ; Fri, 11 Aug 2017 14:13:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86F9628BE5; Fri, 11 Aug 2017 14:13:22 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 A39C7285D2 for ; Fri, 11 Aug 2017 14:13:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EC267267664; Fri, 11 Aug 2017 16:13:19 +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 8B104267665; Fri, 11 Aug 2017 16:13:18 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.15.14]) by alsa0.perex.cz (Postfix) with ESMTP id E7CE326762D for ; Fri, 11 Aug 2017 16:13:16 +0200 (CEST) Received: from [192.168.1.2] ([77.181.164.13]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LwU2B-1dYcSO0B3P-018J39; Fri, 11 Aug 2017 16:12:23 +0200 To: alsa-devel@alsa-project.org, Alex Deucher , "Gustavo A. R. Silva" , Jaroslav Kysela , Jose Abreu , Liam Girdwood , Mark Brown , Takashi Iwai , Vijendar Mukunda From: SF Markus Elfring Message-ID: Date: Fri, 11 Aug 2017 16:12:19 +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:/yDuCz7v6knXyGGmfP9fI563+9KnUDOODRCjDFHueUD0Q7aUfri BXGlq8YCePkwSorYI34APO/iajN9Ux/43/DrX8hiNh6gknsiTL5bwtQwL53p4YrrDUxAG26 +EV3kPyXa7DqCpxODx29UMgnSQ/pE8Cab2bTyfaUpgnwTaRnzAEJeIXmQYIb0F2lE8bKn9c Oqk4dEq5ojoIpeDrPxgqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:LtEWGBRx4GQ=:VHe67uSwiM6dHpJYFNpw4c cv2dthwW1izuTYaQSw0n6tLMUmRzOD999HqyK/lB0RZl/oZe0Sewcx8b2agu+aLzoheQ6k23E wieri0jMOaXZpSPQe55r9jtR6PQceuw2nMiHIFMoxTzIjK/1nx45OHokYs51uEZ8YMCyjylQ9 czJUCEuFU92uhAEwAV6GUHO0UCR9rfRDb6zVcn2t2AOJIpWGJ1WZwlR4GsF+R6E5Ge7u3DsrU Dm4P4OeuiQLT5ksy8Zv0B7vZEYoxACxBcn3L/d1pVhr+2qOLcsKH7uR8MNHQRoRvHRbx21nDt lz0MSmroeO2bqKg9TX6huLLEevLG/GIl+HQmBbRruIdva7D1cmOr+XTEpyqBP8yembvYRLsU+ jlysfncrVntEc0SinQsreTDKBrtFnI/kqQwgM6NsffTM0OgPK2FHVmctipdHfzTqPuJUD4mKX uyIJ04nRdzltwvYndHS0snVhD/+hhROQFlYzrXeJ/ZJfyRIu9mgzJ3ZVxA4BFgbvUp4KvE0L8 E9aMgBTXMLLkwY2DLxHazaBYXz81ByYa/74nzh1CtonQSq5UF7jghareyMPZM56C1PiqPKM0o maCqXLpwLctp5BZpJ7pAEBE86RGMj8dryHZYRMx6GeXuDhPcMKLDm2iiO3UTsGaw4PuWWmDOO qUk2Tcox8Pn0ms+o70Kqri5d0pIOEQmFu3M5KqCimhd313ukaImHTg/JB80ebZZkiOrTm6PwU Mqo97wpRyRMzeRn0AIZLdUjZA88bwmU+ewhZ9lTD+09W6ngrmKCJItHwDgOfZfbmf+wNeQQot qNZzZfrJrbmaiJceF6Z4uz+mU9TtQso6DjyNm7y/12Gk0wlKYg= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH] ASoC: dwc: Delete an error message for a failed memory allocation in dw_i2s_probe() 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: Fri, 11 Aug 2017 16:04:53 +0200 Omit an extra message for a memory allocation failure in this function. 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/dwc/dwc-i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index eebe9d34e7a0..e27e21f8569a 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -617,10 +617,8 @@ static int dw_i2s_probe(struct platform_device *pdev) const char *clk_id; dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); - if (!dev) { - dev_warn(&pdev->dev, "kzalloc fail\n"); + if (!dev) return -ENOMEM; - } dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL); if (!dw_i2s_dai)