From patchwork Thu Jan 25 19:36:22 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: 10184745 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 0598B60388 for ; Thu, 25 Jan 2018 19:36:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8FE8289FC for ; Thu, 25 Jan 2018 19:36:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDDF728AAB; Thu, 25 Jan 2018 19:36:27 +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 95E6428AAA for ; Thu, 25 Jan 2018 19:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751209AbeAYTg0 (ORCPT ); Thu, 25 Jan 2018 14:36:26 -0500 Received: from mout.web.de ([212.227.15.14]:54273 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbeAYTgZ (ORCPT ); Thu, 25 Jan 2018 14:36:25 -0500 Received: from [192.168.1.2] ([92.227.186.52]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lzaxm-1erbGO3sPa-014mYD; Thu, 25 Jan 2018 20:36:23 +0100 Subject: [PATCH 2/2] Input: da9063_onkey: Improve a size determination in da9063_onkey_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, support.opensource@diasemi.com, Dmitry Torokhov , Steve Twiss Cc: LKML , kernel-janitors@vger.kernel.org References: <9b0e8f6a-6386-d307-34fc-7936c52bd0c6@users.sourceforge.net> Message-ID: Date: Thu, 25 Jan 2018 20:36:22 +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: <9b0e8f6a-6386-d307-34fc-7936c52bd0c6@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:K5BNWoEUJBOQ2DsQhaCbanziCtoae2okfT161AuPQn+ZdQuD2vR JInwPifvd2c68DewysQ9Ph03cZ2e8AKQ9kFhlo4c/M19Csw+No+u4uKmvf2QTmY7DeEICgT Z2nl+EtjTX+8iwa9SuRXd0iVvL2nFLYfDL5DWqSaPm3+uuCIpJ3P1lR/j3+FCMJf9xi+reN hzJ6LeDnVVGDYm19/imRQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:UQWtIo0Xf4c=:knYXGZIHevmQrfpn4DTblw U1m8oTliqEXxh+doW8RfF2KEOIAfsxnL9mn2jAryRhCjqs97w28eOXdI7KLtYh7YzTrTcrHv3 VPOB1JFJp7JgjV8xA9mgE7S+a+Ozmx5PISXybeZmJzFns1D+DDPAn+wUR9tVNOXdabWUTE1n5 1p9u5WP2Zh5ajozT4Hm7uQ1gZ1b68uLbY9tIvk5LWEZ9HhrAAKfwbQ27TWISYVQm4KFmFWo75 x2wqpNlYewWz8ilNR/3WPSX2HfKKw3Thh60vwjvt6foCmtg2bDoy1g72H10Qqw5Zr5GgOZyz+ xBCJB2N2mgxMhYUi1j6rp+f3TgUxakm8JsRJhzBHSE2zvIozuxXoUoBpFX7wyDQQCEI1t6Kh/ T/25Gt5HeXuSzpWHhTg2glY7AfM/wvxB37bANzINgpH7FPnkr7rznjoAtoR1MmS/LLJ26fzTL 8IhgtcqHKrIN7S7PIVqCEw2InmNf1wVqR6olb4qQhsuCLw6VJLCUqcaECvGhPCkYk/QKTgiOh C7RkdPNOlEzuSNnK8W/VqYAdn8lTvr03Xd35P0RZRLwGKEA1iJ9YG/GS3PoNyXKk/ExvB/G+D bhQAI0rOQgYtBDIELgm3OxKqvVYaf7Jbkm7uFEiIzIUBjHb0LzGMMpT3FckZL1kpAAi+uxGt6 SCNvKNxcPKF1KRAwoOENidY7t8Vsax4TucXIOGyK+BHsByWivYdeFjKP4AEkRlmgZwqiRZhNf DVbjorS37lH80yMDlhaLNFDU084gzNTT0jWLPPqIl41Q36FsMppkOiw8MBmVAKFtNwhbe1Nea 2Q7F0ZwfjrmNb2GGI9wup4wBMPnD/95Sla7gsIyl0V/sZn1ogw= 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: Thu, 25 Jan 2018 20:24:47 +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/misc/da9063_onkey.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index acf592975bef..310f9c408636 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -213,8 +213,7 @@ static int da9063_onkey_probe(struct platform_device *pdev) if (!match) return -ENXIO; - onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), - GFP_KERNEL); + onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL); if (!onkey) return -ENOMEM;