From patchwork Thu Aug 10 16:46:28 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: 9894223 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 A1D2860236 for ; Thu, 10 Aug 2017 16:46:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9344228B53 for ; Thu, 10 Aug 2017 16:46:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8800428B58; Thu, 10 Aug 2017 16:46:52 +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 3329028B67 for ; Thu, 10 Aug 2017 16:46:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 08E1E2675E6; Thu, 10 Aug 2017 18:46:42 +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 923F72675E6; Thu, 10 Aug 2017 18:46:40 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.17.12]) by alsa0.perex.cz (Postfix) with ESMTP id C40012675DB for ; Thu, 10 Aug 2017 18:46:38 +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 0LvjrE-1dY7JZ3Xhc-017SqP; Thu, 10 Aug 2017 18:46:30 +0200 To: alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, =?UTF-8?Q?Heiko_St=c3=bcbner?= , Jaroslav Kysela , Liam Girdwood , Mark Brown , Takashi Iwai From: SF Markus Elfring Message-ID: <85e3e6a2-ecbd-5988-2460-d4f8ca6062f9@users.sourceforge.net> Date: Thu, 10 Aug 2017 18:46:28 +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:SpeKJY1Ohq+MAvaGc2xukHSppsG89cApTLv8Ed9j4dQS/Xkx7iZ 7u5crJgMK4rBhM/b4myVC4RfzNE3npSr9zpGyDdpTVamiR/dsxcLFGJ5Unv9B5y+cgJxwEK /dcHme8esAdduZlZ9PXyfzLuMf5h6hb8v+2H/knC5eW/iryP4HEkffTg5VoShMB+n1kpiFX FiXgMUVsLLFgJRqO1s8Gw== X-UI-Out-Filterresults: notjunk:1; V01:K0:2cuowijFyCc=:yD0FbTbuib3/aPIpEX/yT3 GrHWCFMXcAccLc/kRuuAnCnJ0H1CCwvEjI2SeC1JLdLRUi9RRjH3EWoUkiQmpONPCX1eaql8P KQOKdF+PKu5t/GtLk+udvr34H0YS+jGTCNOvGKFW8QiICj3YKTZYFuX/nna4dV7weoKc71KDM q5QMJ2GwoFL7D46+8vR6Nqi8wxz3z47yfXAR7OJpUNek7O0kFTzN4lBBnl6wjYjP4dAhDbniV E+cdYZROKx7Ms09S+tOp6v1XIDeot4i0GfYV/1K+Y8w5ABqyYyUa+TiW73Ei0qnuzonw/wsaC WNlqL43znExp9sPRhtJ26emKld5/1qeWaEwzUJEAilYZv7udiERGxz0sEhMhvmNhfgsl+6VnO 3ClrwT+nPAArVR9Gawd9WWiPGBuabbJCxDb9OT6alJgbXOPULUk3ySAFmwbhmHopvWMjRnK/D 2ivUPR3hnGBcwNklGEsrqcF1K+Qodbq9ujUgDkGN7RE7Rp7UOAAQWCZgVwoLLEUt1JbNUsGt4 QtqkesC9bNVE3a/CFvV2CPup699anDzvBbhrfYPpNnbo3p75vUnnCdhtoaiUKzJeUPrDTqxgR I8OUsaaVNfVInbsIpWOQ3GeIXbbiZTI4Y0646IOWc5ecQ1NjmBesVYCKAT3S2gLYMuD5FEjSn B3rWwb30JsCeuVljIykfydfpOjoXYKJibe9EQNw4sgKC0rE0XBvUrfMm/thD8fEjxTqlgBUXS Qsot7uc4IYaI0UqmLlLUhuA9r2nHDFHQVdbubib790qNT1nuPlgtMpC3aLVR3oeefvKuh18p5 a1aG2rfBuXu202Z3WKbYkgbpNw7GlrJm6N3WWgA3YOdzy8BfxY= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH] ASoC: rockchip: Delete an error message for a failed memory allocation in rockchip_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: Thu, 10 Aug 2017 18:38:09 +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/rockchip/rockchip_i2s.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 199338fdeda0..b6590467fd14 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -579,10 +579,8 @@ static int rockchip_i2s_probe(struct platform_device *pdev) int val; i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); - if (!i2s) { - dev_err(&pdev->dev, "Can't allocate rk_i2s_dev\n"); + if (!i2s) return -ENOMEM; - } i2s->dev = &pdev->dev;