From patchwork Sat Jan 27 12:14:16 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: 10187437 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 8CF6260383 for ; Sat, 27 Jan 2018 12:14:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C34B28B60 for ; Sat, 27 Jan 2018 12:14:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D15128B63; Sat, 27 Jan 2018 12:14:21 +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 108F628B60 for ; Sat, 27 Jan 2018 12:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbeA0MOU (ORCPT ); Sat, 27 Jan 2018 07:14:20 -0500 Received: from mout.web.de ([212.227.17.12]:57333 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbeA0MOT (ORCPT ); Sat, 27 Jan 2018 07:14:19 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MZlR4-1eKyqE43tG-00LXm3; Sat, 27 Jan 2018 13:14:17 +0100 Subject: [PATCH 1/2] Input: max7359_keypad: Delete an error message for a failed memory allocation in max7359_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <95f7f53b-fa1e-8270-ae4c-5b3d721a4831@users.sourceforge.net> Message-ID: <7ba43976-2b29-abc7-6d08-e8c49b4564a6@users.sourceforge.net> Date: Sat, 27 Jan 2018 13:14:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <95f7f53b-fa1e-8270-ae4c-5b3d721a4831@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:zquxFD1wCuc0EQyzEJRpG3abZhVIYa90OT5Tl1eTf5SU72NzZ5K ZNpw0Q07TGVIO0K8ayd7JprD/jiK1PEkghL+2sT3vgbmVzJ9K/tNJGHTF6buTFrVovLHkoK i2A98kq94YYwvV16RYuP3LpNFPyL+rT2wrIupXuv37H7coy7EQgd04dArhKP0lNUlwx780d f/ZRuk+N5yeL1HD3Z0jaQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:icLipXTj3ug=:IwKt02UtJQSXlS+rbm1lab cB3vojx7bovncSN+e636/b2dJ4GJ28vb2Xa2P7L8RKoOck1htstCUgaABqKPTz96hNt0gm6p6 16wlV0ZQWtzNi5zsxkqlSe9a6Ez0AvrGZlroP7+ELzYoC5eCG4206gayIjl5q2zj4XqnqnVQ2 jCBWrnUROUandqBgVRHkDIW/MCYdGpUKFeKWoDtaSZ9cbSOYYEnAfhslABeC+Y3ZQWDZqNh8E K6d8WZ8JqS6t2mAoGfKDO4YxtCLQa1bFGW6cHhcShYqywJ7w9qHqp9h3y87D7oCSJSim8YDE/ N3RKF1ZBdVpi4nctBsOFDqSFdrftUAEtmoIeQeNRVogW/jJyQVOB3RA6dNeHZjti0NCc9FHWF xMNBiNHfOQRjUrBr04V5DE/o0lQUgWIXAHIp904PqMAMhs/EXQi5HCc61xaGR2OZ+W6vbGUOY Sibml/31+I+P2WeJvKH5O7Aqb6DrgK+eYDoe1RTIYRi7w0ITbLaakbNrGreaRsoFvH16eM8aK KeqYGdzbccqMcijnwu0oe0av/rSLFkTTNUOHpKbQZ3Xqas4fSgAZ4hFJENstL3tZiYmIiMHFz 4tgwrC46n9xv9k/xuj7JVjSQWhoUiqvpwBDkKjpojCW0wEWocb1nC8iljMTw+iPPJ7MjoQKZ1 X3T43izUW8kVT1LiI4jL1X+aCEA16Ts5PZjcDvCnvmhh0/5ms1413tPGttzvgN4a01QfKFQcE R2TfUjriPwVRldynmPiGBH13cqTVD+MQ3Zxf4ccsalOMfNGhHGoBHPiCWQo/1YBXyW+NkaeoV C/xTRn2AyFHjk7wetw9anu2BJSyXM1L9daIsJtb6g+qfOnci7Q= 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: Sat, 27 Jan 2018 12:56:25 +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/input/keyboard/max7359_keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index cd44d22d8770..ba6a670a769e 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -184,10 +184,8 @@ static int max7359_probe(struct i2c_client *client, keypad = devm_kzalloc(&client->dev, sizeof(struct max7359_keypad), GFP_KERNEL); - if (!keypad) { - dev_err(&client->dev, "failed to allocate memory\n"); + if (!keypad) return -ENOMEM; - } input_dev = devm_input_allocate_device(&client->dev); if (!input_dev) {