From patchwork Sat Jan 27 09:55:28 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: 10187425 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 1D3C460383 for ; Sat, 27 Jan 2018 09:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07F6D28B6D for ; Sat, 27 Jan 2018 09:55:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F093F28B74; Sat, 27 Jan 2018 09:55:47 +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 9C2F828B6D for ; Sat, 27 Jan 2018 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752474AbeA0Jzd (ORCPT ); Sat, 27 Jan 2018 04:55:33 -0500 Received: from mout.web.de ([212.227.17.11]:64529 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbeA0Jzc (ORCPT ); Sat, 27 Jan 2018 04:55:32 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MeBHO-1ePMWV3FXy-00PvSw; Sat, 27 Jan 2018 10:55:29 +0100 Subject: [PATCH 2/2] Input: nspire-keypad: Improve a size determination 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: Date: Sat, 27 Jan 2018 10:55:28 +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:Tn5IayO57h0YTc2hcsx3XPubXYY4ClWPQPToUdB1SaVmyy6TJoZ PBQ5uvkxs1vxdQash7Pgteku3YgUxuGsbTIkoDIfBM+zC6tjZeiLYs54B8sU7sEv5pD5Qiw ZysGhw0WF9b/iRczrsaQVGbcnqALYhXZREbLC54p0b4ZrFlOp2xy/FWCkXY9RTBaAhOcfxw QZhOG6ni3lIVg6NNTXZ9g== X-UI-Out-Filterresults: notjunk:1; V01:K0:G98NsqYps7Y=:4+jWnhztWXkSqpITNeA65N xan82Z5BeHuZutSMcslayVG+BH5gfPajYrxHlfOZldSwuXT3a9ZwyKSKNio71kFiUZSOojRon 7PRvWZ4itDxxTnQOK3+4Lvaf8Ty8NSdQE3FLP10+7NvkM7NPEb7FYDfYXgIjf4jxGTZlL7TeF mL+yT2u1A/jJIbAsoVktDxrvIcI2+Bz5DEgEg2rmq9FASeF2ZFaPpd3ZrfO59FLo0IJEfplhi ZycTllDvPJjmiYUVFQUTRg2wKtfb83qeTRaHHyPOZfZCx5i9KC6fH8anQf7vgy9QABXs7ez1e 8vZGEzbca8APhYejXWY6eDOgktZZLY4TojLY5KQDaOOslyAZFO/bzjIJYAjEztdCBm3b+efsD C+TJxoFMvixrZDhVid2vGGCWZM8ePs75ET9l5Tv3exLUqsyIzAqXrc1kV4jpmmS3mvPpWr4IV ZIdt6yklEYwrE2wYw7t70EINDcyvEWNE2mMUk7HuFrAZ0PSgJJgMYfazIXwNOWczmiMt8pBay 1CW9U57nag4Eb5kRMZ1iUv07AA6uHIzqBbi/rtvFjPeesrkrRZatVvvy6f0az+yMr6/KWjmD5 0bMHvBMdxdnpvqYJW3z8O0vmalCDq3abfDeTHIFCZ4eUZnUrOneEpRAgymukBYGFfQUSHVce4 a6Eb6/lDVRychytXLG5Jw4kElazFhtziSoefo/DV8K3ERA1/3prHAOI7wrZCLEI57tkRnf/ap fGkBeE2p8J7uZwnU+/CaF5cbx2dMA/qjkXMUZR90hEe6H71nmd/MTvh07pzquyrgJKirfVWUt qLLEFZtNbqQAVpCpuUJWz/fHSO1o1e+nSTIpO+o4qnIv36gKPs= 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:36:20 +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/nspire-keypad.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c index f13b50213f94..caadc99741c0 100644 --- a/drivers/input/keyboard/nspire-keypad.c +++ b/drivers/input/keyboard/nspire-keypad.c @@ -173,8 +173,7 @@ static int nspire_keypad_probe(struct platform_device *pdev) return -EINVAL; } - keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad), - GFP_KERNEL); + keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL); if (!keypad) return -ENOMEM;