From patchwork Thu Jan 25 15:48:16 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: 10184273 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 E1B2060388 for ; Thu, 25 Jan 2018 15:48:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0E00287AB for ; Thu, 25 Jan 2018 15:48:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5C2C287D0; Thu, 25 Jan 2018 15:48:39 +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 501B1287AB for ; Thu, 25 Jan 2018 15:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbeAYPsi (ORCPT ); Thu, 25 Jan 2018 10:48:38 -0500 Received: from mout.web.de ([212.227.15.14]:50263 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbeAYPsh (ORCPT ); Thu, 25 Jan 2018 10:48:37 -0500 Received: from [192.168.1.2] ([92.227.186.52]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MXYTG-1eKGXs0N8g-00WSmm; Thu, 25 Jan 2018 16:48:18 +0100 Subject: [PATCH 2/2] Input: sirfsoc-onkey: Improve a size determination in sirfsoc_pwrc_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Barry Song , Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <07e55fcd-8ba5-bae4-0d05-34ada8453a47@users.sourceforge.net> Date: Thu, 25 Jan 2018 16:48:16 +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:rn/AEhe8S0KCwKm7tjGakImX+erekl9dAqZYOBFkNU40rPa+PnS QyPWCab6MveT9vkfTXu1BIpdpzOftqOfNflJwVzv/Pyq1hSS/j77yO+/ULcAXcVL31AX25g EYiqp5hOzB11+hEuRifA8oW9dFt0QQsPmNfH+OscMt/xiEXMjol+S+6RzOKMK9z19wyOaf/ ykrTNskUHqzOXLWRk26Ew== X-UI-Out-Filterresults: notjunk:1; V01:K0:jiDmKO8B0ro=:qomiN3GHS4ZSipjiURaTD1 pDDGji777RUz8MI/kfs4xWc+KeZzW4Zxqgy2T3vpal6UxFSSsCqHe9Q8sNH0rtAcTa6h8O8rZ mYSJNg0o0h3iaYwRfAje79XA9V9NSly9JLrUODEAIMDaP0yHUeJt85/A+QEUKgGWeu+YSFiNt BM+AFPD4MEouoBzrKgsfNFrF79H9fXyd293kU387F1nfXz5xxU+ksdbOh9ke+1JgqrwX9sz8n Oil84iIV1wyHSUl93xFUxXtdmuW9kBJvtkhlLAtvlAOfaO73h5RLfJx04h869myrTuPuHJJAm +uGsTMgk8lwKCYLIUISHQzjwRSWocJXyiz79rgurC8C5mt2xFkKRCpgBJqGM0wS7MKeA+E/Pt EgG8Uj7Au6Gg/tis5z1KSbm/HIiR//d/RS9MdV6zUFsOG03JJfBlPV3wF+fxeyYGpXLghxdNQ vXAf6epG6Zz5C9wyqmKCrw9mlgGgD5YPij+4qm7fdcdoS6O70WloWQaSMiwyqpb/E2+8q9gIP 7lIPtuel7YX8Nn824ZGOjFv9Rv8gsAEFVCn2+yBseWTsn9ouMBFRJN5Ccnp3LFWTQF+XCP/Uh HZ04o3lhpZJPEDeT/qBurBC/Xtcq1jkEVZnF99Ozz26vw50GvBSohrZHTP2/xEk9ZxmnzLep2 H1EZezaSbh6NThSwNvdWkGu0u/NDFjnsqBFi+Pg6oFvyNA4YxsBsZqqMj1nUqhlFoZFEop3gE xOjJGgEeoJbsHH5ZtIQnnH5zIwHjOfpqe4nk4hZY7ITHsIb9Pu7UiPv6jM8YFlS7KVBwHnSoZ NlrK8bcIuLn1h0ke1/nKNAqwL8qmdoG3P0oacmV18tYWNFoPjg= 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 16:35:13 +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/sirfsoc-onkey.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c index 9d8b4e2d7063..cdad20811d35 100644 --- a/drivers/input/misc/sirfsoc-onkey.c +++ b/drivers/input/misc/sirfsoc-onkey.c @@ -111,8 +111,7 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev) int irq; int error; - pwrcdrv = devm_kzalloc(&pdev->dev, sizeof(struct sirfsoc_pwrc_drvdata), - GFP_KERNEL); + pwrcdrv = devm_kzalloc(&pdev->dev, sizeof(*pwrcdrv), GFP_KERNEL); if (!pwrcdrv) return -ENOMEM;