From patchwork Thu Nov 23 20:04:42 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: 10073309 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 BD2C2601D5 for ; Thu, 23 Nov 2017 20:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B00E82A014 for ; Thu, 23 Nov 2017 20:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4E492A015; Thu, 23 Nov 2017 20:13:06 +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 E8E5E2A01C for ; Thu, 23 Nov 2017 20:13:04 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E6ECC267344; Thu, 23 Nov 2017 21:04:54 +0100 (CET) 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 12DEF26734C; Thu, 23 Nov 2017 21:04:53 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.3]) by alsa0.perex.cz (Postfix) with ESMTP id 87236266F1C for ; Thu, 23 Nov 2017 21:04:51 +0100 (CET) Received: from [192.168.1.3] ([92.224.135.232]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lpyh5-1ekzl43JUV-00ffNX; Thu, 23 Nov 2017 21:04:45 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, support.opensource@diasemi.com, Adam Thomson , Jaroslav Kysela , Liam Girdwood , Mark Brown , Takashi Iwai References: <07c631e4-e2df-7ae2-ea31-9430c89dc8e3@users.sourceforge.net> Message-ID: Date: Thu, 23 Nov 2017 21:04:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <07c631e4-e2df-7ae2-ea31-9430c89dc8e3@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:xl9wjEqE9zcsY80EMgeL+H/I5w6XGZolvcUGHrz6hn/y665X3VT fTD3Um7J7Xs22p21gkvC3WeMp645H9R+IyNa7jY+zd+APdUJ7mPe4tYrqoE05Pd6DkqY3PG M7iKFAauIbF0Isweb1ybccxctT1FgBojvLctGVOHFZPYV4t1+WmObvmG4W1S37u3yhdgnik ZkaG+1MLQBtrdrJn7EdQg== X-UI-Out-Filterresults: notjunk:1; V01:K0:8k12kKZc+lg=:w0zFS9VQUTF/U43rvSsej+ R/ZFnc/lt/SyslgmDnEOVcn3dZzn8UmMn1D2rNTbntzIjtKnP7b9+KhV7PCZGKUMkf8xWLBAu XGFoSzRmPkCOel1bAK1XftZ+kU6MchdszauDfj9llANRp9/KPAkubof87ShfuMCIXt3Gw3Kiv CRgQBufFg7nKRBUnP1YaxqcvLRjMNE+UbN3FB1sOl7C5lRgRCBlCZ8b3gDX1f04dLns6xyycM XA7sLat/cbZO5aRK5xhdgLGnCfZEyYGChCQUjG+pSOt+8CXsKMltYZvG7sBKFSn5y8pIkJLTH tHJ/H1AR6l/SvXwcxpZJ80hh6X5o2Bdbp2ifYJKNq4bWpKdn+ytaUgadLpW2Hh4Ljo+sNssdH 1pZYKb9jcZkWw7amVKor9b2nbmzpIUnWSKejDJ3mAs7o8uOoLZQyPc+wZEXYUVxIdbbTTsjjB WTb4a4WQCOWs2RiDuTKCniuWlAM9mTGACDurpzs09dVd/yTh5jh3lrIT61QAetiT8NgC+s4zx adjqmKZ2gAqrzM3Vs/hu052UBOwQMkRJfgguohTaQLhfHndQ79iSyE4unDRZ38mswzXj/F/Sb Son6DTAe0VgPyp02jkBbP+ZMfhC45uaR9Az0QvO1J8jNMnQmVxtU9O+i8/maHYX8V4jIOKcs8 ZEz3kH7fRK9XGm1NsRSDT4voXHjDwbV+51W1PdFJf8zHOz6loy+Z9lMvPRR9d58Mc6eRJGbXb bfuI3/iDd1l2kkfpqRGM63l5Vd68F8WNQwjZxgf+rH0tbPB7e/vdg3Vc7u04Sz0a8DOdmov4X +M9Ee9qu/BFrmA1t7mQzj4T2hwvweGb2mlsOp/z5rag3PX7xJg= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 1/3] ASoC: da7218: Delete two error messages for a failed memory allocation in da7218_of_to_pdata() 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, 23 Nov 2017 20:42:20 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Adam Thomson --- sound/soc/codecs/da7218.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index 56564ce90cb6..25ab7443d803 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c @@ -2455,10 +2455,8 @@ static struct da7218_pdata *da7218_of_to_pdata(struct snd_soc_codec *codec) u32 of_val32; pdata = devm_kzalloc(codec->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - dev_warn(codec->dev, "Failed to allocate memory for pdata\n"); + if (!pdata) return NULL; - } if (of_property_read_u32(np, "dlg,micbias1-lvl-millivolt", &of_val32) >= 0) pdata->micbias1_lvl = da7218_of_micbias_lvl(codec, of_val32); @@ -2527,8 +2525,6 @@ static struct da7218_pdata *da7218_of_to_pdata(struct snd_soc_codec *codec) hpldet_pdata = devm_kzalloc(codec->dev, sizeof(*hpldet_pdata), GFP_KERNEL); if (!hpldet_pdata) { - dev_warn(codec->dev, - "Failed to allocate memory for hpldet pdata\n"); of_node_put(hpldet_np); return pdata; }