From patchwork Wed Jan 24 15:15:59 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: 10182701 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 C54AA6037F for ; Wed, 24 Jan 2018 15:16:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2D3C284CE for ; Wed, 24 Jan 2018 15:16:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5196285C5; Wed, 24 Jan 2018 15:16:05 +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 3E214284CE for ; Wed, 24 Jan 2018 15:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934016AbeAXPQE (ORCPT ); Wed, 24 Jan 2018 10:16:04 -0500 Received: from mout.web.de ([212.227.15.4]:54899 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933948AbeAXPQD (ORCPT ); Wed, 24 Jan 2018 10:16:03 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MevzF-1ePKty3pqD-00OaSF; Wed, 24 Jan 2018 16:16:00 +0100 Subject: [PATCH 2/2] Input: gtco: Improve a size determination in gtco_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Andrey Konovalov , Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <5c4410ab-5174-ce8d-cab6-7979aa61f996@users.sourceforge.net> Message-ID: <0c363cc1-5532-e482-82bf-c8b59c2bd72f@users.sourceforge.net> Date: Wed, 24 Jan 2018 16:15:59 +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: <5c4410ab-5174-ce8d-cab6-7979aa61f996@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:uO1cnTQKdNE2trGgXzbf/9aZQbBUx5te6DQzDkkots3J0Lte8qo 9lvQY8o23op+Z7jCth7Z5VmLwCtcJh+7LXh2lLMl8Dn2lLxJIi0XUD6THQdsWvYJx7Cv7nY GwtlkxlKhYlH+rOsASVRCduD1hyLpK97HiPxsWwt7dFMU9TluRYa8xAmDyMPDUEhr7ULJPL r40qUef3xZiAqMxi3W8MA== X-UI-Out-Filterresults: notjunk:1; V01:K0:iZkk2ayazCE=:OfIb9jbSgeju5PP97EKpdk ITajvTCtDuadH64U4UsO+HOmrsgNARKFYNbG+ABSGiuN481yZ46lcC2OyvY3+efYi44cPt7sf /GzAm6s39kLLS/gzoAS+f7JNdKlL8k8JViV+KoPgTRF9bmgEUjYNFKylVnYB6OrsbUdl/lJl8 AA4Ihf+tD/wI65BtQctFPRnFJtVd+J84vK60vKT6wDM9RRhkB7yad67Xl4NtT//mOhlVEy3U0 /ch7q2N93qzaYaYt0XBADzepR3K8sgE7yYXbMb+JQgVUrYsZSXm4sJQvtLbetf84WjZ4YDG0y KuYLdEBJRLL+xD6kdPlBGgHA4MEWh31xoN9laFvR0pyU/WvpSC37niC3cMmwB5MwAiN65PoU0 faAzl6/yDwn2htFXCX3WwfApJhoQMuD8ZmS3zCwElcLtajAIPG/J4EnStX9WPOf/EzU0SrN9q T6T21iJyzp2PB2RughzEr6gh58U1AdCxttea0N2KpevWpSGXvz4613iSZSZWaWGN91lffdaeB DZR9j5vJmbvhDJSufNjzpFdcO2CLfLpZSrnWEfCDeIzan+A8V4EF43F74A4pM7xf3Q8Qdawk/ HTuPg50k2Ey58ZQL/QoBEDQYFiIdKB0rOTvBoyyZaefkuqrS0moPKpeFwmU2Gfi2oz3PQK8F3 Saj0oLcM7gIRl30aZRIPl6e3+rB6Mgp0KpRNquAqh2jHQcbBvJWLJf4GSRXtrdbw2+lZLLh/i bZXICfiWrKzE9isq176J6nUk/60IPS0/svbW8Qh+jp4NyRyzKEtXuAHIGi971KhTPVpgwdiIt OqKP8nTH6TZ+Hc8ilPOB3faBrzfVrHbMxtRD/IksWJVKU9sUcg= 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 15:08:42 +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/tablet/gtco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index f2670872735f..6094241d4aa1 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c @@ -829,7 +829,7 @@ static int gtco_probe(struct usb_interface *usbinterface, struct usb_device *udev = interface_to_usbdev(usbinterface); /* Allocate memory for device structure */ - gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL); + gtco = kzalloc(sizeof(*gtco), GFP_KERNEL); input_dev = input_allocate_device(); if (!gtco || !input_dev) { dev_err(&usbinterface->dev, "No more memory\n");