From patchwork Sat Jan 27 12:15:06 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: 10187441 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 5023D60383 for ; Sat, 27 Jan 2018 12:15:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FC612895A for ; Sat, 27 Jan 2018 12:15:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E3F428B62; Sat, 27 Jan 2018 12:15:11 +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 D35A02895A for ; Sat, 27 Jan 2018 12:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbeA0MPJ (ORCPT ); Sat, 27 Jan 2018 07:15:09 -0500 Received: from mout.web.de ([217.72.192.78]:58480 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbeA0MPI (ORCPT ); Sat, 27 Jan 2018 07:15:08 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LtWo4-1en8e62DW0-010rMG; Sat, 27 Jan 2018 13:15:06 +0100 Subject: [PATCH 2/2] Input: max7359_keypad: Improve a size determination 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: Date: Sat, 27 Jan 2018 13:15:06 +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:joFGHGQ9JJBvY9PHCJofpIHnrVsmVV8wg5qq+wjoLDMbIYET4wQ Gc/O9DgM+xi5JKzb8yuAIwqzBznPq0LqiOn8T2M3Tmron7p5parpbUVCJI07VRNfNNDZ6uK TKd46sJhsU5UdT7R4WzeuJFm9PGo5zeUv+0BaHUes46kQw6MSmILRRbP6Di+SX+Pg4AuuEO D5ytvzkFulYVK8SSCrquw== X-UI-Out-Filterresults: notjunk:1; V01:K0:NdUfnX2UhFo=:T1v7yuYcMvaTmx2amgYPwa Bfh6hnmyPblj+6yFlT4+XS5NboyzUB2Dy8z1QFYso7r55yaojTonR95dnBcJrA8ZYIGglU0+B A/oa6+N/F3UROYTk6KujgCeyGpCl8aXX2uPTXChRPkm5pMgWvR/9Bd36xAXV4ualMNeFFJQrC DO7/rT/vlwhgQ86aT1Hw818mP8+K17rwefJPYY68pchLMHHigBnXqe93w7CDBii+aB3pcT9j8 vNRws353bPTzYqvTp70GoyCSwMgQUuVLaV45I/ba49P3uAfhfg8HxDo6k0R7TK0do+HSaMr9t LfeIUXjnhTsToVKFvMy/xm/aqbRSXePpNaG58W9hdoKeMUOXx6oqAc5gPsUkAz20nJsTmPUsF 1VhD0eVGuvRCwQTyrzBW4kMwUZLXvDbHjwYwN/dmQck38WLkutoJh42E6QcpmU8+bZooulrIQ LfX3NV67nlGDhcQ/BIQ+vTdRGQWCfotjD+S19uo/TJsb0DHcb8Ox7TYb6r5+3AuB8jDK8xSO5 rw7mEMFjOxCNcsrdXr9xySLf4eROHf91FR4gHjeYu9wefwak6Uo7jCEOFbwSJL7YmlRFpz1Rs cW2UZo38Cx4hdF/p+cocRBA25O68InTTj0uerNC1ngLrtnBBBvI7UKiduCfxmtNScps/mQr4o Re7PsuTpDcdxQjA8+pwZ40L4+gvNhhDSgX0/8yDefJcd0TUbIc+fI1V+HTkhy9PCK1oEprQuO KUXmIdtXOQ9yGDvX2pQam9HBL7ycVVdrHQ/2tTeJVqTk+R1eCbVjm4lIoRnieUAmzr5P1ZcpQ slDeDwgKBti4OYIkQ4AegUTOaiLGIt6myUx6u1SEf/gsUHqkto= 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 13:00:10 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. 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 ba6a670a769e..7791250b4667 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -181,9 +181,7 @@ static int max7359_probe(struct i2c_client *client, } dev_dbg(&client->dev, "keys FIFO is 0x%02x\n", ret); - - keypad = devm_kzalloc(&client->dev, sizeof(struct max7359_keypad), - GFP_KERNEL); + keypad = devm_kzalloc(&client->dev, sizeof(*keypad), GFP_KERNEL); if (!keypad) return -ENOMEM;