Received: by 10.223.176.5 with SMTP id f5csp1906595wra; Wed, 31 Jan 2018 13:27:49 -0800 (PST) X-Google-Smtp-Source: AH8x226t0M16WFCKS8FRaWSH+9Ea2dGM+a3GdBHOAhinF1z0zbD1wD3nDd/O2/rb+cnACXUM7V3M X-Received: by 10.101.80.69 with SMTP id k5mr10788155pgo.447.1517434069322; Wed, 31 Jan 2018 13:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517434069; cv=none; d=google.com; s=arc-20160816; b=m+OK/JHmtvWMzzRt+LuYJ+zBg2PIi67Y7G8FQWMmx2cmb4toJaAogMOcIqrmlZEcBm y+zuAB0Y3Nq4QMrP1YyMWUx/L8XBT0pPWy6pk1zAwB/HoH76LMuEOFmOvrr4zCYsv+Pd XN7Gv+awCS4s364FPx/CwFP29Xvty2iMh63quqirCO7v9cNNwsZKrpS7XKVRFBef/hZg Ws7mm4xwxt68M+B/ktHL+bR1TPSqHA0ExYZWB2LvOXUFuLKBK0uJknhYJ1CVqtFOUgic 5zxiTF9dmY5Kbd1Ot/1+p1wkaG1OMGwaSiQBbKVxAsLd2rlUbbrCkTV2BG0dMUGX1STH Razg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=R43/G9w1KZMZixIZEPgJMsRPnskM5GHKD4Bra1oHZrk=; b=xl/Xa936e95K2wTyepn5FL0zBpnJDnNq3g5sbFQ2QcLk0lSCZdudge7PzAQkeimXUA 0bTBgWCObh5VqOpqu5WvrGk7y7+NK18PEyRnoWp94PHw2Q5T6uxnbMVzMFh2ST89yRxG uCdduJcEW9bzrvhVYt3V9OT3SGhuzBVeuI7D+TpS5/bb+MN7MAVx4gqjnb8iZRyRCTqK A3PyZDhFx6qmMW8sPTQNJSzM6qQ8yvDk414xQP1pSpTMcZmJ3joyeyjaSTYeZzK+/j2G qbsxvqLCrQQS/qnlyPrZupfsmG1qMbCgf1S0rOkuRgLEsWmSUnX2h6UMHhRt8mTcDT7o 8zSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si8458049pln.408.2018.01.31.13.27.33; Wed, 31 Jan 2018 13:27:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbeAaV0h (ORCPT + 99 others); Wed, 31 Jan 2018 16:26:37 -0500 Received: from mout.web.de ([212.227.15.4]:50414 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674AbeAaV0f (ORCPT ); Wed, 31 Jan 2018 16:26:35 -0500 Received: from [192.168.1.2] ([77.182.166.142]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MKIti-1ehXrS1WVC-001lpJ; Wed, 31 Jan 2018 22:26:16 +0100 To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, 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] hid-sensor-accel-3d: Delete an error message for a failed memory allocation in hid_accel_3d_probe() Message-ID: <0406765c-bdd1-1a82-cf66-1c248063ae4f@users.sourceforge.net> Date: Wed, 31 Jan 2018 22:26:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:GyNLTsejwyzRjMjVIBAhV7ueMdmMsQOPSQMWiJdnxoqcv7LcUR1 8Vv6g9zLm6UBHZj9AsNMI1SG9n4vsND11HYWn+cxrzLVBtsg+8YSR7mBa+xanOqyiUsJ++T iuLb326J3NRWdHN1X9QnGJD7LPHEsuYeUXk5zmMq2rslSRi1EmOKtljoyk0C8LaIqrio2MM shAZysaCjy6Z216llp/Aw== X-UI-Out-Filterresults: notjunk:1;V01:K0:a0W/ES+goc8=:+gVpupWmIAQGsnc2ggft1F kI2xrWJ0eYA1m/adRiis3Y4k3XP3SfotFhGn2n17vZfi8i8ZIn2F9GvmroGlXPnk7/K/tMtsk LwykjQ2z+q3zio0DARz1SuG7jteJZtZIS2MozqfeU/NN+52dNibrZQhT32PipvS1CHNw4uZn9 dj53qPYrIIgeLNdrhUpfYwSGdUAgnBdcyUzGbX+DiMvuebv2gFn+AodSiAqlc0o8izbunfQ6S QDMVzS87GGyErEvE0WdrccjuGZlYGVbCQCLQXwOZ07JcROmrlfLUxr+yUT/f3EuaKjIc9UHIt HPQa26rsFs0bTGUAaVNOOcFymkGrZoHlD/ifttYpbZoWeO/4xiGs2oHo7fTMzCvPDVr4mq7YE V+BQLTPgheUzh5QpfXnV/6Ib0kwx4uHBmE2l0oQQJmUYGHsEzfPfQViiQ6sIsG/auIvs6auX4 Fw0a9n/cZmTCONHPfGx46YMWDfAb6YqpRMEURcHKlASvK/TzXVucURzui+7qBNSj2tVQxqgda zmK0/hQZBgp7TFeZpKzQrEC7ZWBi3hncaZD0tNhJ5OX1rYZmCMRXPVteOUzSRgZTW10fUq7h2 791cNMKh98hlzWCHpzRlwmxdHbJ9/a0fRNbl2OZJ7Y0etCSMtZJdjLinwBa8/Jx8/8kNJhDys IhYA4rcZEEhY/KpKdCep3I8+5ubOhLu+ykJkJmnLtSN02/GJrnrgyduc6QiirebGbOmmmHKNU fTvc/uaHihKEy3Z+BWZHlm60UvF0C2v42MNv4TxacMWCuCNbH1qSYiWzQPxBvFgAKoQmFaNPd NPfKnsxXER3ugi4tZwBcWlL7x2eK4QjQd9QTE6lY/Up9h7Fe6Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 31 Jan 2018 22:20:56 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/iio/accel/hid-sensor-accel-3d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index c066a3bdbff7..3d0acde40285 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c @@ -383,11 +383,9 @@ static int hid_accel_3d_probe(struct platform_device *pdev) return ret; } indio_dev->channels = kmemdup(channel_spec, channel_size, GFP_KERNEL); - - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } + ret = accel_3d_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels, hsdev->usage, accel_state); -- 2.16.1