From patchwork Wed Jan 24 20:32:08 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: 10183069 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 AB3BD60233 for ; Wed, 24 Jan 2018 20:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 898FC27CF9 for ; Wed, 24 Jan 2018 20:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C5682895A; Wed, 24 Jan 2018 20:32:15 +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 1D20E27CF9 for ; Wed, 24 Jan 2018 20:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136AbeAXUcN (ORCPT ); Wed, 24 Jan 2018 15:32:13 -0500 Received: from mout.web.de ([212.227.15.4]:49405 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbeAXUcM (ORCPT ); Wed, 24 Jan 2018 15:32:12 -0500 Received: from [192.168.1.2] ([77.181.242.198]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MBTXi-1eXGBj3ddm-00ASSY; Wed, 24 Jan 2018 21:32:10 +0100 Subject: [PATCH 3/3] Input: bcm5974: Improve a size determination in bcm5974_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , Henrik Rydberg Cc: LKML , kernel-janitors@vger.kernel.org References: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Message-ID: <02af8e7d-b6f9-10f9-4f56-de657477bfd5@users.sourceforge.net> Date: Wed, 24 Jan 2018 21:32:08 +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: <0505482c-287f-8809-76e3-960cf45b3c0a@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:hRRaD0y1SbIvUdLHqwZZkMnd7FEttx5JE9w083YnVc2942WT0Su B5ia+d2lqTt26y6Mc7DQzlx3Yg/aC6bgUO2qnjSk+jGFiWB+C5AQ47mdFvtnsmuvrxePMNI trwfHzxQE5CZNiwX351zjV1cb/53X5738zMj9b2pFiYGjjj8r90ZCSudLglYV7bYmCQMnhk Zx4JsZ6NPOOfvVn6NykxA== X-UI-Out-Filterresults: notjunk:1; V01:K0:GVUzDTFYOAI=:d6vcqVGgJtcuitUf0XbNu1 kw+lYJ99aUBQHhZHeWib7bdJHuQFqYCeV6LaMgkV7b1i9JGZDs5HRTwF/JXpoBNHfU3aFwp31 PYYXFdB2RaxCdeM+NgiVK5TvkD5TzsfdNb6CWa4GYr6Q5R5Hvs6xnK9q6679Ze15LEyR9/D4r Btr4hJFTdpeAAHXmth143IyrZA1LNmZ8eQrKoZpAYi3GQYwU5E0NT/TmVHBeQggSnWMhqR0i4 ktAqwN2lf9Pa1chTgLX4pXSC2zGRc+kVb2XWg4A1y+nFio06jbhxgddRWvrFCIzLrYJ2klJeP FkVqin5OY7zGzHmMwfPqIQz7RxSKBZseTQb003I0HxpsZ8fJZrqFd3hv96RmxYIpXS2j+xlNl rhB/EisDYraZ0/JUHT+aHyO+LpvCYBBAZGoEskCZhX+HR+rP1qD8s+aexEPzOFQH6thLB9Rei f2BuHapBQE8Exp5/6gNF7buu3sal3/9crZ26T2befPHKxPKk+tFkgerGW5VD39tR+0bvOgfLJ KG3QHufqJ1eqkP/aSJJiL7KXQPyO3z+BqFabF1OawGeDT9ynIHIWv8WOLxKex1L6aW8bFhOPk i/aVD9hte71J6nqtbGvdTcKtKrKFnMrdbmaorp1axxYt2g5CXrkV5XhzdDKqqJDH+W2oNnyIH +2+bLH/QIOfAETn4Yqaq74Ozjnr+4ANp/g9ErhXBK2aEM5fsqzDOjdBsD4o0lcWt0c9tGx/qf vnKJ0srIDV324nlr2Zo1QY7Pbz7lKp2/CVHKnI0QSjOHZhdDIZjJYnpzmCfuA6Wq3aPO9h9a4 CEOctCa3H8QZiM53KAn4qmMyxptnOqltfoYkQNZvwyVFcN8kCE= 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 21:21:11 +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/bcm5974.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 685f56c08931..c827b31c8530 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -915,7 +915,7 @@ static int bcm5974_probe(struct usb_interface *iface, cfg = bcm5974_get_config(udev); /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(struct bcm5974), 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");