From patchwork Wed Jan 24 16:35:47 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: 10182823 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 A00AF602B7 for ; Wed, 24 Jan 2018 16:36:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90EF628968 for ; Wed, 24 Jan 2018 16:36:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85B3B2896B; Wed, 24 Jan 2018 16:36:09 +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 2542128968 for ; Wed, 24 Jan 2018 16:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934286AbeAXQfv (ORCPT ); Wed, 24 Jan 2018 11:35:51 -0500 Received: from mout.web.de ([212.227.15.4]:61291 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934249AbeAXQfu (ORCPT ); Wed, 24 Jan 2018 11:35:50 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M5Oql-1f01ql0TxX-00zV2e; Wed, 24 Jan 2018 17:35:48 +0100 Subject: [PATCH 2/3] Input: apbps2: Improve a size determination in apbps2_of_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <50013a33-b7ca-fce1-9769-bfe3db850a8a@users.sourceforge.net> Message-ID: Date: Wed, 24 Jan 2018 17:35:47 +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: <50013a33-b7ca-fce1-9769-bfe3db850a8a@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:w16gEv4rHxgRW1P2E+UQqKzcADHybN/Pgmp2BncLzcZbs5TTJaJ LhVOQ2EnxJY3RM7EFo+lQ/2bYaluAeSHGnBSdotZO8mfmsBsrv1yJJYs66lVTLTfdwEpElZ GZv5J5YItiSJKCPOr7ni3qnH5DlGMUr/DGIY8YgZBqox71nEtQXRZeJIdrvNHvf7xL+AELs EgW07RFLhg6qnFH7alV4g== X-UI-Out-Filterresults: notjunk:1; V01:K0:8yxCBrSkgjo=:krO6OtZ9VO/PQC2Y/d3JsE r63nkDUSSO/4mUHBWSoncYgixR3Owbz4Lg+CLuEko0F3j2H9lcEDuGr+48WXfQpexMsRDuYKf 3dXgh9T2qS5lx99CZi6j68DMdH3pDjlXO+yCzyCCOUnP2/FB7L7VOZ3d6sXaCt+1F3S1SxpK8 otlsQgeU/4S+rGUcZN1U3tphQlMyf4eRZug+ldO7YkG7OhtZpQNdu0mcGlpCjkpLhd9JZplrC Lc9FkV72OnjlCBqPY9DrTI3c1ETDwAzMp40JZ18gNBlqVIaINuhsF8Ux11TAm8hsoV1a2IEXT FzcoYSngEYU7lCXnmtesKgzP6zsJKSXD6hT4uimi06Mb7tRw9ibszDoeFfEEpZ5u1qj4d2Sew 4WX+7uVsBxBrI0bUeLFx95W4vfopY5DvquESF6HuouwugNdlNsfUOK3ZL7QeqlIxrSD3xHUo7 ACRL1XcKZVgFAlT0F+NvBz5VJgdwk7254YmCxfxdNvTXqWULzvdDpVtI0C5dmhpLQs5rk08GE V4nrBKA+5ss3pdZUchNBXq91vvqLvBr5rw35JKiYvuOB2snMPKZe1H0uNHrH7smz9hwpmbG5m j1m+FKS4YfGP4htAnGU5wUFmWYz2wflj92+L0U5UwcU89oo82v060Vs8vnGF0f1DzW93t+Otd N4av/3BGUX/e5q8R+v/ER2u4wmzlwo8n9EhwIUGRNq0W2d8Pz5Tj4MIewB4VekUzYlEcyKShH EZLzUO/gCqqhLS5f+dgEXAuBeT6TijTwAs0Kl6TI3WRehOq0PzMrwdQ4CjtrpACtjSe+E4Z69 lqVxPfbRo/yt+99w+PPo1aSN3RAreMoBxqF3QCdsPdK9lIBVXo= 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 17:15:39 +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. Signed-off-by: Markus Elfring --- drivers/input/serio/apbps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 9b75c4e1bc13..a1c64df3b6cb 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -170,7 +170,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) /* Set reload register to core freq in kHz/10 */ iowrite32be(freq_hz / 10000, &priv->regs->reload); - priv->io = kzalloc(sizeof(struct serio), GFP_KERNEL); + priv->io = kzalloc(sizeof(*priv->io), GFP_KERNEL); if (!priv->io) return -ENOMEM;