From patchwork Mon Jan 29 21:04:11 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: 10190849 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 55B5F60375 for ; Mon, 29 Jan 2018 21:04:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42FE228939 for ; Mon, 29 Jan 2018 21:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36F8428938; Mon, 29 Jan 2018 21:04:55 +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 D1B9F283DA for ; Mon, 29 Jan 2018 21:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbeA2VEj (ORCPT ); Mon, 29 Jan 2018 16:04:39 -0500 Received: from mout.web.de ([212.227.15.14]:56072 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751925AbeA2VEe (ORCPT ); Mon, 29 Jan 2018 16:04:34 -0500 Received: from [192.168.1.2] ([77.181.96.112]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MeBZO-1ePID8279a-00Py5B; Mon, 29 Jan 2018 22:04:16 +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/pressure: Delete an error message for a failed memory allocation in hid_press_probe() Message-ID: Date: Mon, 29 Jan 2018 22:04:11 +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:x1g34cZMt9SmF4u66+nfV4Mp2u6QecCmpFg7IMUk2oslb8fGwR/ JoBjl4CS4EI3lkFWb1w90n+AjzMBR7sJn0639n/7UYBIicy0kXZduellE2WLsqag7nwesQv 15G01pi2kJuE8aT6aV7KVERCo8MGUOhGeDx/LSamem8WNfpD9eXVgBMIJlekJBJDdufWKW1 wqLSYmus2ljDQjJQ+HkcA== X-UI-Out-Filterresults: notjunk:1; V01:K0:FoiQrI5KLug=:jQfV0o/PmeLmD9RCq65zNf auAr5/rdLZ8uZ8N8l69Qg5oIwRD8GHouldNKwyJa/OYUcGjOaZ5G7mdEqfkJOYxZrO6H3YhpM B8yfDto/NYRTAu5/at3oQ/vAQBbyvWEk9/VFAky4wVvnW7aJYk+7LUJzOjVDAawo8PwCP8Nh2 l69D//UV3xjjxU+Kp+XEwDbYWpFaqq3gsmJAZUIxPkx0ZDy/9WxpPObALzZBVprA1XA1psnsf RyJ3Lxo1KOUEdqBRxvdCphX44WJb4M+9yZUYmCRhCrHwmwaZSkK0aH+e+dWnezcoot+x8/mdf hYoCOzvZMN7QyJgg3b/Re53NZX2pWsJJGL0eiX7b6AMJ3PBh5RuGs5uWZOPhXnxKVNvBoHVPR e0xWKlj8T0QXbUfqRCnbg47hXSU99HWmhG6SIKvLLZi6+Ldq0j4FgGtc1ERWqJieWcGPPBWos RIT+9Nlh3+oHqDQ0vYTUuAq+ewaAflB2GYhZiUdGDmMhKZLy6qW2BD1+jOCt1Dkte/9OjyvR0 /LNpBG5Y2ZCgSIHfknAlAAG4+A8dNz7DchauiMDHdFRrDkI0fnUM7xlWRa/kf0njGuGcS9DBU BDOUHqO/No9xqVr1IHmUg6tOyYxl3PR1wEymt6g/hLWCJXCMP2kU/qhmVYoD0cy9icRucHA4B xkiPyE7CVPC62+v+VQnoEfQFVu28ORYKf5/PBUvh9umAsAzjypHk4ukWsEgPOIkce9z9T5Y2i 5lGuJfB6RLUTYCjKiL718hsqzMLL25Ka2Vjfypp5j7ADIFlcnCYs+gGzAseE3BwOyjeEh5Xv9 Fhxy+Di4oKFtvZ1wRSeYuYl4U62/XrW3ffXHl6HWo3Zi8Xn94s= 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: Mon, 29 Jan 2018 21:55:08 +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/pressure/hid-sensor-press.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c index 4c437918f1d2..9de7590d50b0 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c @@ -280,10 +280,8 @@ static int hid_press_probe(struct platform_device *pdev) indio_dev->channels = kmemdup(press_channels, sizeof(press_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = press_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels,