From patchwork Wed Jan 24 21:22:35 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: 10183107 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 7702560233 for ; Wed, 24 Jan 2018 21:22:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6766328972 for ; Wed, 24 Jan 2018 21:22:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C2FA28977; Wed, 24 Jan 2018 21:22:58 +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 0427B28972 for ; Wed, 24 Jan 2018 21:22:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932613AbeAXVWn (ORCPT ); Wed, 24 Jan 2018 16:22:43 -0500 Received: from mout.web.de ([212.227.15.3]:51363 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932474AbeAXVWl (ORCPT ); Wed, 24 Jan 2018 16:22:41 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MfYXz-1ePn7v1CoN-00P4Sw; Wed, 24 Jan 2018 22:22:36 +0100 Subject: [PATCH 2/2] Input: wm831x-on: Improve a size determination in wm831x_on_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, patches@opensource.cirrus.com, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <43f052c7-c98d-7ca2-08ca-e5428b5ad575@users.sourceforge.net> Date: Wed, 24 Jan 2018 22:22:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:hPuJOXbetr4dGS8KsgB6GwWfcvZb0rkiL395wONQxms7IWxKJox hC02jIVkkAv2qCMgLSqSUWcBvIer4yZWdOTevdQOViAMR2AARuZ0O9BbcD70ea3GdsyWo4d KOM5KTggZgJ50nsKeCQjw1gpEAk5MZ08kcVMs5TKGcMTd9+KpTGb5+l7uoXff1rJAnZCUK/ DMoaJQ6lFW9BkQHm5Pe9Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:pF60MYKR1/M=:WkDhwLESaL38vzM3VsnHBr mm8XJnaWWifnydIIMaXDflzhpr9wjhj3YxZYpx10PZDQszUC56zSrWlqQ6Jq4NuoO3fFz4rig oEvUQ277x6676CJnf/HaWSLAK+/yLPLEpRAT+XAmYO0fn9o2IiYVTV4qWRBgjeZJRo6ltGa01 /5tz6DpjY9CsG8GStggM9w2+9s0akGy/1PvKTo+XZXzaR3FZq9geVz7pKCDr2GwylxhtmPs+m kUmYmHl5gQO/6z60QmKrnYHtmBPNnXignCagPapVp1hvk1qZ6bEtQNm8+RJMikWfTAAX424Qo Ffy3tvVKt7c/YjB9t2li9Yi0/n0NkpiKyQTAPHGtkQqn3tKNQyS/2gmuWPNAJ+WJC/bTd9Gd2 yUbzoLJG0lG/eudl6oe+4AUVdsi1O1LYbrV/IfLc0JH/zMSuvuNPcv0uBz5+4odFG2jLu7vWe fy6YO3m73Jh4f1XQH5mbFZZIaUiE8ZwshBdIhw4NmKf0uTHi2PwaiB86c64CK0ZJm5A6t3yhZ uxLTjKDvRbMNYF3FiYgr+J86SwkzpHFCOS1VrpDtnTh/yJexrHVvuVp/otRL+MXTbKJMYyN65 SGjCeK/GtZfCvYxU4oI1qjhWB//bpJVwMSPqx9X4PYdFhKWnanTFjz8RPxgMpMbKEXdMaMrfi bFS1CUbsJ2AqK4j/MMjEE+fAl7A/N7BWvUABLvdQ5XXe4g4MMkjxz7mLw1erchamB/pp3ODyn sayjc6C9WiletrbcYopReRn57/xUmf23iFMqvzAr2UJYUtQica6jx0goydVdx8r9jRv0kjNl4 WPPrE27DEF0JzWtYpYIfug+zhdSh3eklFay7MBXckRzouPodL8= 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: Wed, 24 Jan 2018 21:58:42 +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 Acked-by: Charles Keepax --- drivers/input/misc/wm831x-on.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index 06f5c4857a0c..0d8f7a11f63d 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c @@ -75,8 +75,7 @@ static int wm831x_on_probe(struct platform_device *pdev) int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); int ret; - wm831x_on = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_on), - GFP_KERNEL); + wm831x_on = devm_kzalloc(&pdev->dev, sizeof(*wm831x_on), GFP_KERNEL); if (!wm831x_on) return -ENOMEM;