From patchwork Fri Jan 26 13:50:05 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: 10185861 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 0097D60383 for ; Fri, 26 Jan 2018 13:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E616629117 for ; Fri, 26 Jan 2018 13:52:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D98A12918F; Fri, 26 Jan 2018 13:52:42 +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 7B2CB29117 for ; Fri, 26 Jan 2018 13:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486AbeAZNw0 (ORCPT ); Fri, 26 Jan 2018 08:52:26 -0500 Received: from mout.web.de ([217.72.192.78]:58877 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508AbeAZNuI (ORCPT ); Fri, 26 Jan 2018 08:50:08 -0500 Received: from [192.168.1.2] ([77.181.101.79]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LlF9O-1fExRL3wiE-00b6Wj; Fri, 26 Jan 2018 14:50:06 +0100 Subject: [PATCH 2/2] Input: omap4-keypad: Improve a size determination in omap4_keypad_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Christophe Jaillet , Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <3df8e062-2a39-05c9-bf49-c85fd636abff@users.sourceforge.net> Message-ID: Date: Fri, 26 Jan 2018 14:50:05 +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: <3df8e062-2a39-05c9-bf49-c85fd636abff@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:dR2SY1zUwEbhoxPFRbA2MttZft2idnkYlPDuB00Nj37Ttrev8ZX OW5kX7GK/bohIMX0xD81/UhpjpzZs61Qd37WnTZGDcoAtzRcb1h3w73EvTLrvFEj3E3i8E1 fOSt3GksFdHR97648fDR+bRTk9bQrACzIMWtbeArUzobIsrW7DR7vJi21s4UEay5jQVWSo3 CkYv1haveAIBLdSOpGIJA== X-UI-Out-Filterresults: notjunk:1; V01:K0:vcvD4Av/23c=:L/AOMU26lqFo+aq3yuNqIV 0AGCkjq9bm9BJfe80LKdkBEsd7B1+xDSW+2JYHHGvKxzy+6x4jSPIKvUjlBPcVbVGG3xa03Mc g75P6KVPWS+9vwNOqGGQbPsRiw3TUBCjYVz6iappZt/dOHS3nvmqJGm4CDDwdB/zqOjCD+Y/J AUnXZpcD3iuF/W4Yp75FuQb496MXW+WFNfR50qp98k+PIfaZLuZztRXfpR9kM+A3Gd1TzUO00 6Ks6llj7aG/DoqEYS4W3y+b4MrTOTB5nDdKWZtk1cUgTbZkZvLp0Y0Ri5WjYvXAaofta0DdQj c8fvgkMEUlKuwL+KjHKwdp6fW3Q/vZh0XorT+WvupeL7A0lIzIpRqzzAsQuRpfc4L+0efH0V+ f7D608ysNjhlW11rqemcX0lezKcMIZC4T8jbxVHH/I0TKI+A5Im3MyiSpu4VgT6oz9sJxJJAZ wW6U9D4RzF7SwJisERUn6BZ5UBxcb4q0z/kX6m8WFU/g3EdfJY80X8fYspj9qhPz/H2EbqzF0 n+4Esm54RSQk/BRW857IdYRjAyWLjBj3I7+swOM8lD4HoieZpd+ntl7U5ZbxdEsa2DEygbOhc OTiI70oTFApeC2Wl/R7hW2TuVIbb4wvqsj4oRaKWcZOitrHOJE2Q0pTpXTm1adg0Y7/rmUziE d2lM4dxGinP9xWDI+uRMvkx5K451Fk5eCJUMxR1HodmzNEyyk/l3ocTzEu7N9kY84Ii32QdNq saTrdKkAxp7g6X+fVfNgpbeG3ivQZVnfjgJhQ2mku9rw9Fj/xbB3PrEudB6DTQ9Vaezs1Oy0n o8C21sKCs7Z7NUOFMU0pTlzIql1cC4hFf3ohPZ65HGdDhsOx9w= 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: Fri, 26 Jan 2018 14:28:07 +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/omap4-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 6fe554e4026e..4b5bd0c611d6 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -256,7 +256,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) return -EINVAL; } - keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL); + keypad_data = kzalloc(sizeof(*keypad_data), GFP_KERNEL); if (!keypad_data) return -ENOMEM;