From patchwork Sun Jan 21 19:48:37 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: 10177069 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 EBCD6601E7 for ; Sun, 21 Jan 2018 19:48:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9E531FFF9 for ; Sun, 21 Jan 2018 19:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCDA0260CD; Sun, 21 Jan 2018 19:48:55 +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 8142E1FFF9 for ; Sun, 21 Jan 2018 19:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751060AbeAUTsm (ORCPT ); Sun, 21 Jan 2018 14:48:42 -0500 Received: from mout.web.de ([217.72.192.78]:61359 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbeAUTsl (ORCPT ); Sun, 21 Jan 2018 14:48:41 -0500 Received: from [192.168.1.3] ([77.181.34.161]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LfRnJ-1fASRL3xBx-00p4oc; Sun, 21 Jan 2018 20:48:39 +0100 Subject: [PATCH 2/2] Input: da9034-ts: Improve a size determination in da9034_touch_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <44ae37ef-deaa-c963-e0f7-c407159afa0c@users.sourceforge.net> Message-ID: <8e27d655-4f18-b156-3d78-a12b28f79b5b@users.sourceforge.net> Date: Sun, 21 Jan 2018 20:48:37 +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: <44ae37ef-deaa-c963-e0f7-c407159afa0c@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:bS4xSooAdosw05Yi635icO4seRePi6XXofA7ZHhCXD76JlXl0Mb Y+4g30mGNcI3Gk0bd2wsxESc9pWCvjEFx+Qg00wJ7OXoecXIvLxnlnZ63RVd3pCbPBVoMaM t8ToM1EuCmwOfPW6UsbXET5VmtIueCXO/T4dGZ6eDfssCpVeD4D1BlNH6WNLJIqCtIub6d1 6z695WGfaNgkNhTP307HA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4dVhHl6OBnE=:g0tyaTRQEKCAqdflj9Rc6o YssS08epIhaVLraWKgHKSBonakzHxzj3JWOyODSt+zM3UdhVa7KrN6lUVrt5vuDa9z3zL9tBX /ASXAbwv1+OWVtIIEZMQ2jsbLelv9ppcVDGL2cX2qinSgALeGfLohZ5jQG+pdFKexOiFIouzS vVmvh/6WY+9rcrQ1OoDQzJrSLTXqpZQSmwOfIlI3E6ljJFS2ZDKV0EeFDcQMh7I2oPGem4T40 BL7sVjvxpjwxfpAZg8TJfjj3JJNT1NhmIKf6jzJu1fSRAw5HhNHQo53NpmAIAyEoUhHYOJiT9 lt6wMHiMXDP81HzQ5uFlW1dVCDF9r3O3c+55JxKLN9h4Y8ITd5SeuoKYYdJ3X6hjIL7iCfshi HbLnBrJxdzmZlLHnF9gz0NxgI5pzgl02WYXwdvhe7L+RMEhcabnTRyp/ffgvwtDwTOdFsFHRd UVEd1ppzoBbeHJeOn8B9XR5COKIDngrTKRstMvFfaXRfv3sP58Hwbb7trBLHe1Q3xjIMwUike TkIt08sANZrxpE0TBh7njyRcbn4FJpf7Je8MQuqq9iD26SW4sNmCcT2Fl2b54YAFOFxro3enq NpECPV3Td6UER+29QKZV7bbLDckLWdxatXYmdxTG5cPt54jodIxPDZ7pS3I5Ew3FjxNJUiMxb PoUHwB4T2wI/jlYduAG7S7/0PRfojmj92XrUTjjyC/d7nm2ACF5zuTllvL6lSuqKATiN3LJ/v +TLgvZtG0exOo1Nu/798+7R0YGQmjyGcrmJFmqwNPJQ99H9zj3JLCKwUatVp1kaQvqgBdb6ZL 3+jX+2pH3Y0QsVj/vzoOPxg5HKi5qPlSQqLZYPoshroYBxVVkw= 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 20: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/touchscreen/da9034-ts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c index b30cfe1e62da..c9c423aebe1e 100644 --- a/drivers/input/touchscreen/da9034-ts.c +++ b/drivers/input/touchscreen/da9034-ts.c @@ -303,8 +303,7 @@ static int da9034_touch_probe(struct platform_device *pdev) struct input_dev *input_dev; int error; - touch = devm_kzalloc(&pdev->dev, sizeof(struct da9034_touch), - GFP_KERNEL); + touch = devm_kzalloc(&pdev->dev, sizeof(*touch), GFP_KERNEL); if (!touch) return -ENOMEM;