From patchwork Tue Feb 6 16:17:46 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: 10203307 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 D16EB6020F for ; Tue, 6 Feb 2018 16:18:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4D0F28C91 for ; Tue, 6 Feb 2018 16:18:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7FAB28C97; Tue, 6 Feb 2018 16:18:02 +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 6493C28C91 for ; Tue, 6 Feb 2018 16:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752259AbeBFQR6 (ORCPT ); Tue, 6 Feb 2018 11:17:58 -0500 Received: from mout.web.de ([212.227.15.14]:63470 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752699AbeBFQRy (ORCPT ); Tue, 6 Feb 2018 11:17:54 -0500 Received: from [192.168.1.2] ([92.225.242.179]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MeScR-1eMBu945h1-00QF9J; Tue, 06 Feb 2018 17:17:47 +0100 Subject: [PATCH 2/3] HID: lenovo: Improve a size determination in lenovo_probe_tpkbd() From: SF Markus Elfring To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org References: <06e2d590-f980-0022-c476-6b999239ff9f@users.sourceforge.net> Message-ID: <4c71a06e-3c13-81e6-42a3-43bae24fe1cf@users.sourceforge.net> Date: Tue, 6 Feb 2018 17:17:46 +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: <06e2d590-f980-0022-c476-6b999239ff9f@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:/ASCWqGwvupVzKn9bEcEtYQtkCxIeCuPKXATveY1zMHeia6Kex8 ypouEEfkTI4AZwxy4HeM1OhkhHOOHg4Smq80r8Fx2hcmjDFF7aQEqBAjRCHgXkE9iBk3CED 4Zb1QVnDiOJy8wLH/obF28OzOi5snp46nK+YqOBt2uiU8nY9BfbNk5f/EyE6FXy2xg7KDNi gd+UZwtbJRZBsm0z4ywRg== X-UI-Out-Filterresults: notjunk:1; V01:K0:SkJtQhQLIY4=:QBW4xbnDI7UaoP0rCwfiO1 wGdGUjz3XTwp2S+hS9bs1wwhATunYos23yj7+WGNITCkI7cUCVVlxYLb2p/eObf/TtKEK4qBD G/8Buc1a/9klI7qwNoFReGJWoldtFBb1rLoAQ79Kdb+Ywuusg/B5MalE8hc617NhDWjW7Im+f B6krN1XDtd8xbAXsdF43cW8qT62ScHZRUnNaThBzU7sULUT5x/hJNmiJthylSXIzsIKpZDZDV GXNoS8anIGbt2XN8N1mLIzQK1Vuo3NBWfpf8AopMgmruyNR5ZOl3zneX70eardGNGuyH58lv9 mtyAmunbOE1s7qbWH7Nd8U957LPeU0S3FpEryX0Z/tLQ4eqXxxG9jJ9CHIyN403uFwPm+0wbf smGLNqwvchooAqp8rujEAkqM1M2Ko2ovKP0jQaeAWYQiVYglA9Ig1hwfv7mlYBFMzv+BkWItN zHXTr2VuV5KxXgS3ereB+hTrg1/75JkuZYLBCpWVEf3y8BntPyt8KKtvC+JMU34gnvLSrCkq8 veyvVELlkqrHihCAwSbcpptnzA1c9p1t5/VE1yS9VEQ6FIEl0QVFreltIFHzY9smyzRIYm9uF wEF7PCg/P/8B3VShP+WPvkRn2Qv28TXglq43SpBGBC3BcADh2zEBETglj6LvSaWT3AZlZXiVX 2p0A/7tCpBzrjI7LoYLktbpNQFpiTE6eDqUstPJxKmYER01DqO5vt+vTwthzXL42dazJ2k5Ed hDVKRhDAjBYJViVmyP9skFCTmhvoJYZQS02OB7zxtRO5M8FJ9U+Kcua8TU5hU3w4ux6AxNaYd yEfj388+JIrleaSzJT0o1tSvaufqj2Sk1eE5vKo5Q8cWzgcR7o= 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: Tue, 6 Feb 2018 16:52:58 +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/hid/hid-lenovo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index 549b84d01b46..f863b94f3476 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -685,7 +685,7 @@ static int lenovo_probe_tpkbd(struct hid_device *hdev) hid_warn(hdev, "Could not create sysfs group: %d\n", ret); data_pointer = devm_kzalloc(&hdev->dev, - sizeof(struct lenovo_drvdata_tpkbd), + sizeof(*data_pointer), GFP_KERNEL); if (data_pointer == NULL) { ret = -ENOMEM;