From patchwork Sat Jan 27 09:54:10 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: 10187421 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 773B460383 for ; Sat, 27 Jan 2018 09:54:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 640FE28CD9 for ; Sat, 27 Jan 2018 09:54:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5799328D12; Sat, 27 Jan 2018 09:54:29 +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 F38F028CD9 for ; Sat, 27 Jan 2018 09:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbeA0JyP (ORCPT ); Sat, 27 Jan 2018 04:54:15 -0500 Received: from mout.web.de ([212.227.17.12]:54300 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbeA0JyN (ORCPT ); Sat, 27 Jan 2018 04:54:13 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MYNrh-1eJdJq20pd-00V5Jp; Sat, 27 Jan 2018 10:54:11 +0100 Subject: [PATCH 1/2] Input: nspire-keypad: Delete an error message for a failed memory allocation in nspire_keypad_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Daniel Tang , Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <17d03396-2abe-4e09-1a86-14773b51073b@users.sourceforge.net> Date: Sat, 27 Jan 2018 10:54:10 +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: Content-Language: en-GB X-Provags-ID: V03:K0:4D2/FKCpXxTKt0lueya9eJX9se1DiQJZ+TQB+uQBUXomMSkCq/+ YGujuv4lVLnk7/NpLg3LXwP5DGKHNssOgxNczXtwCkWunptmjmLUKqv7uDphRymySt/XKiZ JuMXlglMOikYzbHrZzjvDHN3s7q3N6LA9W7OX+cCbzhHVsTpPxab4isDAPWTjEYiM3elIi0 mMVXCIXgxVf6p0W3WH/GQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:v2Oo/U0atUA=:a+qGQqr8v+5nmRubn6fF17 GGtLzn2QDwFtE3MGt3q8IetwZ3bpRdGplmrwLnSVaC5XcI/ywS9K6pVtpJ0T9fsdVeJvxptwq nX+vsLO+0ysieYxqH4V/8/A/i7in+2Jy3xI5XAmPmtUK6ib99mz3daPd595xAQ6936vOgy0TF vSSe6f4Ojy4ltpZPwn6Qq5Es70geLlWo+r2Rpi6gCO5ScDp2FqVLuKt1AxczJbvlhepOSaIn4 qoKqk+DXY0/Er2IYE8a7evItxsoIIVnnZsIH7yb5aMove02L8ET4xzcljHD3mbZF9KMfbINul qKDZZsQPb1m4fTwgHl2DvZQAM0XWhSaqK7w6llHyUj4+C2z6aRGxGySGGeG6blEowWLibJkLo ZQOT5HII2aSCNmyqxT/HkYcQLZ9KzTb0ouM1Bh8TUrLe58JivO1Ph9yIlNazbL6NLReGujOG9 sUKigHbRrVZHf+8xT6ZJ8vR23Xr+tW3x1EMiEDorXsc5bcXOhElYY41tXyZ95Z6vYrFE2vjr4 LGm0DaYHDnaIBlkbKoz/pTlQTd/NPQv1gMY2M1NpLernmqRSXjDpMyK1mbkRM+KSosGlQjz2X RvgcqoumXhulR3LNPCVerPefubIVqa95K6MSNQgd+iLFYmXeNmJwJR0LB8Rs/pzTquH/qCOOh uUiK0BTJKgrBFdlHTHo2O9TTnJfe1/hbp+6BSftMqeVZlx4feD51N17q4lu9WwlQ2iiFU1PZt nRh9KPKIQHkEAf7JjToH/JbfVC6qxQ4aKAUn/4sOiiQ2Yf28Flay6i8HnpB+zirDRWeUKbaDV CuNtV0UFYEvv84Ce9VnuaAbizixscHqsgSuw4tkrcNNPLmYKGM= 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 10:33:37 +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/nspire-keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c index c7f26fa3034c..f13b50213f94 100644 --- a/drivers/input/keyboard/nspire-keypad.c +++ b/drivers/input/keyboard/nspire-keypad.c @@ -175,10 +175,8 @@ static int nspire_keypad_probe(struct platform_device *pdev) keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad), GFP_KERNEL); - if (!keypad) { - dev_err(&pdev->dev, "failed to allocate keypad memory\n"); + if (!keypad) return -ENOMEM; - } keypad->row_shift = get_count_order(KEYPAD_BITMASK_COLS);