From patchwork Wed Jan 24 19:57:56 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: 10183055 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 ABB9360233 for ; Wed, 24 Jan 2018 19:58:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9CED28942 for ; Wed, 24 Jan 2018 19:58:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E2F228947; Wed, 24 Jan 2018 19:58:01 +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 50C2E28942 for ; Wed, 24 Jan 2018 19:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbeAXT6A (ORCPT ); Wed, 24 Jan 2018 14:58:00 -0500 Received: from mout.web.de ([212.227.15.14]:49321 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbeAXT57 (ORCPT ); Wed, 24 Jan 2018 14:57:59 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lwq4m-1epDqf3vsO-016QUa; Wed, 24 Jan 2018 20:57:58 +0100 Subject: [PATCH 2/2] Input: appletouch: Improve a size determination in atp_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Arvind Yadav , Dmitry Torokhov References: Message-ID: Date: Wed, 24 Jan 2018 20:57:56 +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: Content-Language: en-GB X-Provags-ID: V03:K0:58MUI6imPs1nfyzwl8TCPRd2D7SbC9DM2dAGy3v4VibIctzt7/u c3OjIt7NCjjfEqcVW0Vx664XCmnWcTHybvgcK+wLC7iTD1eN13QObC1YaJmAQe7hwl92Zht ZbVxVEg02q99dIH6QRckl9UjA3JpWYCHkSTSgfinZ7r3PKwe4+zmDkbegaHxOoLvEgUfUNF NaM+bs5+aS13Y9sdNbcbg== X-UI-Out-Filterresults: notjunk:1; V01:K0:LgYwm3MJS/k=:4XL9blbiF/Oct7Qrk3tiT6 /eR3lS3O4S0MGH45wfiBjoyZG3gchao32BuikEVDGG6LhCktWPhqCxjogtwKj2nd+QF6BH8pa 95bjJ7DQPeXpoIgZv0JPrNXhOxI3zLXUsTnW24NuzyrVP3q0fXlF8gNhxdApTWeC8+VtAiRmz DzOw+tUTyEkAO2PfYj+CR+539zwUbnXxH4ryVwtwt/kOpAJkLQkZNsbvlz/UmxxhcGZ5FZKaH k1Y+yrdGUdrvN7silYBcu84S3PLfwrRvxyPzLZX7q9XYcm+ikThaPcb1B0+bj5anFA3lKCMVH g6RwhHmKnAwLGZeGAOf9JBMoroDZObWV7Kd94hDFZyZ6TtRAAicDyelPZ96X/kj53bNbPcRYV ItTD2WLw9uaea43WIU66F87TMyz0dE3gp4mGTAK0pG05c5pAI1JSrkr3nFpUpF6t+AcDzfsNz 613JBp/H9uihEsuPbBkpSMFykDTjz8CN5PPVgS4YCUxQcOAwiezn8QXK5rR+OvwnHEQoPrA3I Xg4MqxsJtOocTI5cgvkAddSWLR1uLJ203TSm2xXTKUfJtbY3fB/7rzKM6/tBO96YZw/wp8snP TS0xKpHBORCWwueB42pmiL3Nj+yHYeykhxFia+aanuHDyEg0LLEmJ6BJHy+dYdF2QOR9vdmZk Mq9rJPTSk+YqZMf6go37Fft63IdU5AG0qoQSTccC7FaI3eTUn+BE/vmB5FDg9bga80v1MC8Lq 8YhTt9VDZssSh6mphyRLRZSgNJ5ULv+nS+KxkPrFa4/JM7DD66CPXfGklKtmW46pYhe66LfQg Dsla1en/87Zd/fYabwtmC9Qc+pUDPTltqApKen8wXXAHUjdGfs= 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 20:46:49 +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/mouse/appletouch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 3a709d21ea93..ea4888693889 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -866,7 +866,7 @@ static int atp_probe(struct usb_interface *iface, } /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(struct atp), GFP_KERNEL); + dev = kzalloc(sizeof(*dev), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { dev_err(&iface->dev, "Out of memory\n");