From patchwork Sun Jan 21 18:51: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: 10177049 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 2675F60224 for ; Sun, 21 Jan 2018 18:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16FE12580E for ; Sun, 21 Jan 2018 18:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BEB12621B; Sun, 21 Jan 2018 18:52:28 +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 BA5AD2580E for ; Sun, 21 Jan 2018 18:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751282AbeAUSwP (ORCPT ); Sun, 21 Jan 2018 13:52:15 -0500 Received: from mout.web.de ([212.227.17.11]:52896 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbeAUSwN (ORCPT ); Sun, 21 Jan 2018 13:52:13 -0500 Received: from [192.168.1.3] ([77.181.34.161]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MKrPw-1edKiC1xfk-0003Kz; Sun, 21 Jan 2018 19:51:24 +0100 Subject: [PATCH 2/2] Input: egalax_ts: Improve a size determination in egalax_ts_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , =?UTF-8?B?R8O8bnRlciBSw7Zjaw==?= Cc: LKML , kernel-janitors@vger.kernel.org References: <52f0c32d-2cf9-bef3-4fb3-4120c5b758c4@users.sourceforge.net> Message-ID: <9010bf32-e058-d29d-8ea2-acb43f200175@users.sourceforge.net> Date: Sun, 21 Jan 2018 19:51:23 +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: <52f0c32d-2cf9-bef3-4fb3-4120c5b758c4@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Pt1SOmnkGC/Zn/NMqsPZH6Shozxtweuaif+WBIOBcX8c+iXmmux QKzp/pm1gYb77k6tPBOGKN1EK/vRXjZwNBiWPbP5PfzDPxTD4qGVTqcf97/g18PgJWuUqB+ 3VmxwnPJwjD1A3sYy/IdJh6zY5B2LdiryzR1FPUv7joycql+0+co/YHlTpiPdlH/0sMhYfp FPCkAIIvlSiQVOKz4+Iew== X-UI-Out-Filterresults: notjunk:1; V01:K0:qKsQzrZ651k=:ozTSgrXHo3foH3wUIduStM 19q2iLhdRdmJ2FdVHOuobDHWk/EzOoNDH+90ETATiqR+7MCXCo/pgm+XVimdNRAwQKJjKSlUs aJZbLLt13cwXMVkcegcpCpOoMm7LLCYS3wU9YcrC/eDyRN+Muiz80Fe70zcVmDdaNu4QeHMLV ixsESE+1OdnEUbWspYh6kOKE+jPn+fEzBxaoPE/tCNAX+6XPnGnRIlHrUbs9/jy9tkcXEszVb shVVeCbuoauEyILu+Ek3CNWbxziSa+J8SHpCJJ0qN6KzwCrb7f4vSMpCLVOe6P8FMPJX37DjL tRBuvWIsCpYsls9s/jR37OHjKAMlMpN8vcAONZN9PnaTZG62xaWRamO6ZWxCklyxM9svFxDSL JHJGI8/KnYBQs+8k7ma5z/N3oZQ707JlJILzIv141Xdonlp5DqWwhDrODb7syoIXnXYhOYLD9 gemzQ+RTILD4NGFb7r72c6yAkT/goXilOxhjoXMn+YK0oX5nOk7MT40HlNDFkruU0S0kR03rq vrrOwWqrBaPcageoL1pzfyBA1lkuoVtBmWnBFGrr88Xj/QpK3HrDi1WwkedUjx3beUfPxmvNK S4Yy3kh8Z4rBmnPeYwLohdphiPgXU73PJBoWRsKsAC1z+hVV0xUgclWn+Kp6RLdJWeo1w5HS2 u0EGO9Ruz6aY6vA9c9/fO2ZVMgCNLFBHcmamuT1ceRT5lXtGyN9YhSkHVLUPLR3XYrVWLCPfy knfTcvoM9qeXAR5DSk/+qZ+3Azwq4z4Q/vUAQ3lfnPDsqqRZnTekiXrGj6JhbjOOU3d6LE1eD H/mRDZ3xPpGQJgCoQgwoLpZXpJnGPcN6BUwD6GAcwO00H1gaVY= 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: Sun, 21 Jan 2018 19:40:30 +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/touchscreen/egalax_ts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 29ec1166626d..da8b46ee2c1c 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c @@ -171,7 +171,7 @@ static int egalax_ts_probe(struct i2c_client *client, struct input_dev *input_dev; int error; - ts = devm_kzalloc(&client->dev, sizeof(struct egalax_ts), GFP_KERNEL); + ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); if (!ts) return -ENOMEM;