From patchwork Sat Jan 27 12:54:23 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: 10187455 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 E200460383 for ; Sat, 27 Jan 2018 12:54:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D436528C7A for ; Sat, 27 Jan 2018 12:54:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8B4928C7C; Sat, 27 Jan 2018 12:54:35 +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 C026F28C7A for ; Sat, 27 Jan 2018 12:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358AbeA0Myd (ORCPT ); Sat, 27 Jan 2018 07:54:33 -0500 Received: from mout.web.de ([212.227.17.11]:57282 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752523AbeA0Myc (ORCPT ); Sat, 27 Jan 2018 07:54:32 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MX0UC-1eICCC3hae-00Vvct; Sat, 27 Jan 2018 13:54:24 +0100 Subject: [PATCH 2/2] Input: matrix_keypad: Improve a size determination in matrix_keypad_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, David Rivshin , Dmitry Torokhov , Rob Herring Cc: LKML , kernel-janitors@vger.kernel.org References: <106bffd0-28ed-7c33-1f32-ae84b40f52c7@users.sourceforge.net> Message-ID: <8098317f-46bb-fefb-936c-eb82605c565c@users.sourceforge.net> Date: Sat, 27 Jan 2018 13:54:23 +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: <106bffd0-28ed-7c33-1f32-ae84b40f52c7@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:cSRPnPz/eKbVNTc+zOcNqBoGWVH2+T5xQDx0sy+R3VRyEgJ4rM2 K2Rro6x5nNt6BAJhfRu/OLzeXruvKZrWWYeUaVnXFV0P5ls8dF/q0YCDaZIUVhCdSCV4zfC lJLNfUH6KTvblPvjcGZOJokFp5pykAVi20XKBLj2R4MX8eTp5N6tQjbvcNrYO57j8dBSEBp PXaaAHThNpUq/ZvcRaMXA== X-UI-Out-Filterresults: notjunk:1; V01:K0:RJgwX1YPBC0=:b8gQbitGqj6f2/UrZaRU7B +vavYgSay2jfWYpCBUdn+P8Ov5h5/lpLMohNDWM5EqaDhFdGD6OT1VQ67Uda0MUBKf0Nie3Tf vYSiTli9OxmsFJjwD18MUyWTOai4EzCOjd74u2CtPZNNm3tRHsGfadTEqB8H8vpZ9O83bLIyC fUuQRUm2lMqNIQYMoQbbwaiNF/wZdsiaibH7/C1+w0fbPr1kkmZdWTql/6ri/+YzEiMk5lJlt 5OfbH0LLuN15A2t3pVDqdok+oDJ1Z7kpU17yoQgN2DFZ1aOqKsE3u9YfuB/AQbvhgifbv97KY TcSeDElGnJGw9Q4ii4kHT69L6ufvd0cWJXRMxIre2zbi/txOBKd0fGbCX9RfLtzGBpulUlOC3 KE+o7e5XHIo+dBrksNFopV8Xv2UbkAUAzsmzXFdBAETlhx3vZI1E+fRNv8yoRfeE/sItcFp69 2XUyupfJKwS1orEhciXbyARcCjQHsfNwGsieHzCwD6wb31rTy/+HNlALrLrkGZdJ1MaSbVLXN 2frGnB9PjkqN5s0UKcDawyGtBRhKzefzgPW4qO/HL4h/um5bV3Mro5QMgIQzlmCmfh6yZ7iIw 8dfuZkXxTqL7/pz/oB0vmtQVMJ2tkwS/kuDuZ3cPGpm31kEyjfGh4u0UMPPigUx3jxcu3uynT DCrg8hoyR7w509NlScg3TXAmMwMHoAy/Wajz7O1ccuzloATywqI5VCJf+NiHhhEIVPPavXVep Szb/jjW7sYYYFWYBbzigw/H1HpKa8hX1/XEbBaiucJ81WkHpfor8SRwSJpJFyA4O/vhuEHP5Z oAIYvxYjcY4z0XvzY/Gi3OqLssNdpVSD+iesrfIN7qht/J7Ow0= 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:43:16 +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/matrix_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 90238201a9cc..16206a8a5f07 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -487,7 +487,7 @@ static int matrix_keypad_probe(struct platform_device *pdev) return -EINVAL; } - keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); + keypad = kzalloc(sizeof(*keypad), GFP_KERNEL); input_dev = input_allocate_device(); if (!keypad || !input_dev) { err = -ENOMEM;