From patchwork Wed Jan 24 18:28:44 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: 10182943 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 0646760233 for ; Wed, 24 Jan 2018 18:33:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E12A620416 for ; Wed, 24 Jan 2018 18:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3EFD28581; Wed, 24 Jan 2018 18:33:42 +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 C54D920416 for ; Wed, 24 Jan 2018 18:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964983AbeAXSdk (ORCPT ); Wed, 24 Jan 2018 13:33:40 -0500 Received: from mout.web.de ([212.227.15.3]:57532 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964850AbeAXSdj (ORCPT ); Wed, 24 Jan 2018 13:33:39 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MYejS-1eIutg0I0g-00VRmK; Wed, 24 Jan 2018 19:28:46 +0100 To: linux-input@vger.kernel.org, Andrew Duggan , Benjamin Tissoires , Christophe Jaillet , Dmitry Torokhov , Lyude Paul , Nick Dyer , Wei Yongjun Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] input/rmi4: Delete an error message for a failed memory allocation in two functions Message-ID: <423a3ec4-eef2-f663-d6b8-9ec9d31ddfc2@users.sourceforge.net> Date: Wed, 24 Jan 2018 19:28:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:OyX4EvIqncIc8GEQ6LqatDlf1ws5yPnZSBr/H4YJvCNYmU5tn3U c0Cnck+gFU8RSMi9ZTlrdPlB+OiS6zeF6Ju00vi3NVr1AgF3HOM3KMwKmE9NNmiav/915a6 rtmKFiQHgH+5kAoNC9xs6Fp8A3cE1FcWfHTxRn56fjAbGN7WZVR0pCyF6VKk0uvU2XpRQmT idrTEUphPUBUwXubS9mZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:yA0Tl7G3BBc=:pTmjTHklZKRfeyjao2+RIY 2XDGZrocZnfhMCfNj/KTXrAMZc8REO4fs4JJW8xMmjIYzfz4xofRoHcVD8tJGvzg2JgYT5m6o XJnl3alsTcZpcrQMVQY+gpNNBz+7kiV7DA2Kztk1KZVgSeprRGPlfGn9GJi3eBYqKvNvhChYu zFVVQq2ywoEoxbYQa+ULiWLBQzAE1W3PjsHTLUJeIB12SNhMT6wz5WKmrExLOIx2e6ldayMRn aHFJ14fzJ0X1Pl2/ptxcYFOpqLDsL/8gUcgiMwOUQiGTKrI0VERoI/etzC0vA6Mqm3cguuHUQ BTWxDjMCI9BeXRIqt0FkuuwZzPPBcAZaGWifuw9K3f7gNOxEY8aT+kXQ76m7bDWxECmhlLcx+ VTywFZc6Fi2OpYp9kDB15GLsJEbxmowiDAZ4EQXx1VPdP8YFb3FmLNJWVqvX5wE/gXr+Xx3aa ubqbQvwbK1YE1MnPF9YhuXKoEk+imL1HXEAb8sPY7QFWDDhgrkIQcmnHBsKhAyz3QF5erPX2S 0kFxOyiLAk6M0Yz3FwVBEJGAWxyq3jokixCK7ebgeVWFuZ+WXGtKO1/Pk+qll7PxghIC31ejZ Xcm2WYkJdy8m0qdFr3O8uc/IgipvK+/1eqOPfBQNMykdqycow/EPqqf6HCRuydyR9XZBmLaWZ uNrs0jPFICoOJTaGa52YBnSB64nXNWLEhBDAZffUuL+fcfBycGCK80nY1e3Jvd5vE7dpmvnhK 9Du7SK56R8w2klW5djbSxKUFi5PPjjYINrh0GW1fAC9GCXlh+3Bj+kQkcf/Od093UlO0eOrcI Ky0BBS9GWHrCXp3PUs+0qiw8fqaq+1YiNI5Pq3f8YabOQiDhuE= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 24 Jan 2018 19:19:14 +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 Signed-off-by: Nick Dyer --- drivers/input/rmi4/rmi_driver.c | 4 +--- drivers/input/rmi4/rmi_f30.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 4f2bb5947a4e..6c47e4f3ca7e 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -1060,10 +1060,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) size = BITS_TO_LONGS(data->irq_count) * sizeof(unsigned long); data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL); - if (!data->irq_memory) { - dev_err(dev, "Failed to allocate memory for irq masks.\n"); + if (!data->irq_memory) return -ENOMEM; - } data->irq_status = data->irq_memory + size * 0; data->fn_irq_bits = data->irq_memory + size * 1; diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c index 82e0f0d43d55..a111ea370c30 100644 --- a/drivers/input/rmi4/rmi_f30.c +++ b/drivers/input/rmi4/rmi_f30.c @@ -238,10 +238,8 @@ static int rmi_f30_map_gpios(struct rmi_function *fn, button_count, sizeof(f30->gpioled_key_map[0]), GFP_KERNEL); - if (!f30->gpioled_key_map) { - dev_err(&fn->dev, "Failed to allocate gpioled map memory.\n"); + if (!f30->gpioled_key_map) return -ENOMEM; - } for (i = 0; i < button_count; i++) { if (!rmi_f30_is_valid_button(i, f30->ctrl))