Received: by 10.223.176.5 with SMTP id f5csp582346wra; Sat, 27 Jan 2018 05:56:43 -0800 (PST) X-Google-Smtp-Source: AH8x226VuEX+XA8xuxkZwauh1/P4QIXocZ+WU956aHGtM7qR+Hx0bMtoxK8LKNVeTGTtIZCJ4d/r X-Received: by 10.98.9.202 with SMTP id 71mr22098460pfj.122.1517061403573; Sat, 27 Jan 2018 05:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517061403; cv=none; d=google.com; s=arc-20160816; b=J5X5j7rF+V0qCHr7NuhJ/thkYCjQcqxlt9xxDA5Wx6nVbGZ5ZRzJO2XE+9QmLFXS2u vfQDSr6dw0oHLZh/GB3cqVizZSDWe7bx+bWTQUJjBPytm/VS1emfHdlh8PtENuzOB+zS f0ag4912F9FLoeGVtG47va9NBpw6O5oOZvkOUOYoagkAkpM45Pv7in3KYzpKSFlEYmFR PgImSR1/biY87ez0DfGdbicQomHofO6In6KfY9iPeKdgXGuevSw3eINd/StkVn5mmnua ReT6QUScYoJhHGyGlK4Upb2l8tbtnJ/n5UOFPwjcTuZPEFtkRQkJeoXHFZAsuG79vrqs YQLw== 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=jk0BNJvRj4Gh7gYtUTlr29R3MIk9rOAPiHK18OI2PqQ=; b=WcYITpPSY1QeB6lbyUdqn90cqf/ZAitQBJeiwmCsa0Q64ugfpLKQKkGtpSXfQcRcsb opp6H1u3YWyQNeEQCUtrIvmX2CATGgXUegmPyl1Gsm8s6ZHKSIvT31Ds8dc8YVvx/luI CNw1c1xhEimgZONI/drZ9K5t9P4Kou+XOl1zx2mUtA4p/GJQufSgsvpBkD6/agodUcpg nTjsQtYNMYVSRp2u3fF5+2gr2aypnhdfsW+lMAo6lEukwcSLRZEBcNXKIBSX5+YUQRJn a94/TV/xiTDwYi/09V52r4IPKFSqvyT69fUJ9dbbfgQ6IrdRDMCTGJMgL0YH/asrc3J6 VRQw== 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 v126si4457266pgv.616.2018.01.27.05.56.29; Sat, 27 Jan 2018 05:56:43 -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 S1752843AbeA0N4D (ORCPT + 99 others); Sat, 27 Jan 2018 08:56:03 -0500 Received: from mout.web.de ([212.227.17.12]:61834 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752685AbeA0N4A (ORCPT ); Sat, 27 Jan 2018 08:56:00 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Mhlmh-1eT9Hg0APT-00Mrlk; Sat, 27 Jan 2018 14:55:03 +0100 To: linux-input@vger.kernel.org, Arvind Yadav , Boris Brezillon , Dmitry Torokhov , Greg Kroah-Hartman , =?UTF-8?B?R8O8bnRlciBSw7Zjaw==?= , Jacek Anaszewski , Joseph Lo , Linus Walleij , Stephen Lu Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] Input: gpio_keys: Delete an error message for a failed memory allocation in two functions Message-ID: <6a34d439-6465-db9b-e8de-3f3b5b1ca257@users.sourceforge.net> Date: Sat, 27 Jan 2018 14:55:00 +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-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:w0UoCY1lzCM+KT9lH6nadZmx0F2BUrDu+7sRIA85t27IrMKIhA3 BYZVy80Ij1f6h9QDoaF2yC8dpTJwnpMolRu9Kv3Bj5iXAOykafZ1DAR7lgK8DjUktBfBJJK eGZy2CNsunhrM44cd+pw3G/x7/erVvt3qClZbwdVcHQciOFqjXpOTNPokXWoQM1i10vAsWE Y9Avzs9iiv7Txg1s9GtAw== X-UI-Out-Filterresults: notjunk:1;V01:K0:vXBmZpbVDkM=:lJydkTmJJi4ZoOIgbIP5CU jewBlEDJEqX02O8UXwk8PFyq6GKBKFReATMPt08WIWv7bUpcbZi5yMM7LYQsFtFb8c9K+N7eA 33iRbCbyUU4+NbJDaCUJzP3GvjOIYAXBSctOYZxnM3s/VTttLvi8h9D5tkmzIRnGe2aqqJ7Q1 /F4Cd1ysjR2sWZZS0u8ZYvPURNzqoev49nlaUeEeS0ASyUDLuCy7dfz+3fiHyk+J38+f9KDPi D9+fykJSf2Q2QZ4rrMEJQiwJdcGWEVqSVeH4SBEqhAdgE7jeVqgvLUwZfmKxWYHoAlQAu2x35 u59E17ubjUQl2VQ/wiY4cx31zg4RsyFtbQs59ueM1LS/vkejBj3bQdGxHorCCeGLIPbQj5NTs Vv5nR8XuSHRoSS/yRPsPuE0vzOTcawjTJUjfyoKBYMs7woFrKs7AAC89uZX/F2nT8QC97pse3 vQhCLgp5gAv0dJpwtZUZM8t7wiD2yDdlKZwybE5YUc9tSbK/Rqa20qjP/5n2Fn7BUdPW0m58d uSuHPHBcFvl5L++qBDHdHWKZmMzgQuxcAWuQKYbPcKYLc3cpCTbs87iWAxPsuFfOIRJRfv/8G 72XkgSFmXGg/RCRJ6WDxYXdGEaByNWATqueRufnfvac7u2cIqcOKaJ7Kwo7bT2xQQpU/nzEjx 7mshCkBYeL/d4e9Dnkymepjj44YsfGv9GQMyvi/sor5Llanad4sfTHOT3kGqiCU/emYzlDRHN nHR4wqzrIVNB8Mnl7f/MtPz2uKmX8ZZpx4ROKese2/7dM8bwfFakQCZC0rSBQzDZIUG2iwtN3 9cPPRYhv+ULDltYwr/mG7U+hEvKjAOotwvDgStS3ArNEoKISg4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sat, 27 Jan 2018 14:42:19 +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 --- drivers/input/keyboard/gpio_keys.c | 4 +--- drivers/input/keyboard/gpio_keys_polled.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 87e613dc33b8..d12fccf923d2 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -757,10 +757,8 @@ static int gpio_keys_probe(struct platform_device *pdev) size = sizeof(struct gpio_keys_drvdata) + pdata->nbuttons * sizeof(struct gpio_button_data); ddata = devm_kzalloc(dev, size, GFP_KERNEL); - if (!ddata) { - dev_err(dev, "failed to allocate state\n"); + if (!ddata) return -ENOMEM; - } ddata->keymap = devm_kcalloc(dev, pdata->nbuttons, sizeof(ddata->keymap[0]), diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index edc7262103b9..c79b1a75d036 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -253,10 +253,8 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) size = sizeof(struct gpio_keys_polled_dev) + pdata->nbuttons * sizeof(struct gpio_keys_button_data); bdev = devm_kzalloc(dev, size, GFP_KERNEL); - if (!bdev) { - dev_err(dev, "no memory for private data\n"); + if (!bdev) return -ENOMEM; - } poll_dev = devm_input_allocate_polled_device(dev); if (!poll_dev) { -- 2.16.1