From patchwork Wed Jan 31 20:21:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10194767 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 BE02F60380 for ; Wed, 31 Jan 2018 20:22:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A284F28888 for ; Wed, 31 Jan 2018 20:22:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95A762888B; Wed, 31 Jan 2018 20:22:07 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B16D28888 for ; Wed, 31 Jan 2018 20:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbeAaUWG (ORCPT ); Wed, 31 Jan 2018 15:22:06 -0500 Received: from mout.web.de ([212.227.15.4]:58583 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbeAaUWE (ORCPT ); Wed, 31 Jan 2018 15:22:04 -0500 Received: from [192.168.1.2] ([77.182.166.142]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MF3Nr-1eVhQ22iJ1-00GLD7; Wed, 31 Jan 2018 21:21:45 +0100 To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, Archana Patni , Hartmut Knaack , Jiri Kosina , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Srinivas Pandruvada Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] iio/light: Delete an error message for a failed memory allocation in two functions Message-ID: <377187b2-abb5-b693-2e95-8674748854c1@users.sourceforge.net> Date: Wed, 31 Jan 2018 21:21:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:XT1DOLCZ43NqWwyzCawLuADPZwWwmQeBid2ol/UH3pkFo4k0q8s aAf46csaLuK13ltyu0GV6Y/jYYwYTSWbbDpIPH5aL8kct+IrqwV2L5irhUPqrjy4oqODoTb kZzFq1zUPUIO6SXpGyM+sh4nkxP0WOG0IBTSt/bL3N2EI0biUJSkHEHcndalC8vkGFvuC7d dgrJ1p2ANuZOJQtBJU5Rg== X-UI-Out-Filterresults: notjunk:1; V01:K0:nKPknm9Fi4Y=:haMqt9zgX4l+5P/6RpzDeu IxcEAJk7p+IBvkfnitccIo6yWezbNgZPyfLT9LMIGqZrLpkFmQwHZmYama9QJs4F4jg+SoCgz FiyBCPoj75v/RCItkCDP6BJhaVCcCdIBP9dMEyk9E/+k7bO/Kn72/Nmm7rJv3cOdpv25ku0JO MFdMguRrUT1LPOTy8mEOXM/Rd1xD5dsFCarqWMCc+w3I6zVJF4fFVR6y75kPijnbcHsxfDJNZ yafLJ5LEoN/pR2FdGC/ckDYzs7UIZMAQMbmv1Jmlprgg3lSiLkWgDq9TNCw4Iukgci90sSNqn gcR8VJpk4APBdDwGum0BGG1/zjm2Irs/WmJCiDJpCIDboXUhhhfEVhcxNk0yMXe3kLzjSZD3Q 1cnAxoQ4RgK/0DN+1AMZq/t3jw4lXmCDmV3VyRYPjGaitW8lA1tnCZysE0A41DNel6FcdD2me t+n1KZhlFsd9aCnhThWVY1mvBjNTy2WkjKEvEURMzpLxP6iP78GMHHyBLyKwp+294pnxZcBI0 fl/Komo9ZUtDNG/3lvHT0QPWSkUq9+Umi6MjRDzxJENE4OhwJP3fnMhYxBDLrFeXP/dRQEFYl 9Tz/CuA4v9R6l4uaLqp4zMcg+ia4buAThZeGfXtVLt4HEJEuBhmMtj0sPWMBiPv8IoOKEsLHA 56BVqMkYuzFo8qEPBL8icRWI+2SSIOpXaBqa/vmu7R8Rx3995x/BTYSY2nJH3qCBsxM9IIowk SwPyK0J3Bpuvzu9LOsSTIvJ7wAaedvmkBXoZjJaVUfKT/0RP1+mHauNpzZ+2+37jIddVOa4uJ e4aqSxKxUxFdMKfG0aDzkZK2k9kKoKll/+M5RJ2alsMpXGNf9c= Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 31 Jan 2018 21:12:09 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/iio/light/hid-sensor-als.c | 4 +--- drivers/iio/light/hid-sensor-prox.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index befd693a4a31..83654156d952 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -299,10 +299,8 @@ static int hid_als_probe(struct platform_device *pdev) indio_dev->channels = kmemdup(als_channels, sizeof(als_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = als_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels, diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index 45107f7537b5..f4487620e08b 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -277,10 +277,8 @@ static int hid_prox_probe(struct platform_device *pdev) indio_dev->channels = kmemdup(prox_channels, sizeof(prox_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = prox_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels,