From patchwork Sat Jan 20 21:30: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: 10176753 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 366AC6023A for ; Sat, 20 Jan 2018 21:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F98205A8 for ; Sat, 20 Jan 2018 21:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1355F2074F; Sat, 20 Jan 2018 21:30:18 +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 B332D205A8 for ; Sat, 20 Jan 2018 21:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756695AbeATVaQ (ORCPT ); Sat, 20 Jan 2018 16:30:16 -0500 Received: from mout.web.de ([212.227.17.11]:52191 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756652AbeATVaP (ORCPT ); Sat, 20 Jan 2018 16:30:15 -0500 Received: from [192.168.1.3] ([77.182.145.92]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LkPrz-1fDSOY0wF1-00cNHH; Sat, 20 Jan 2018 22:30:09 +0100 Subject: [PATCH 2/2] Input: sur40: Improve a size determination in sur40_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , Florian Echtler , Johan Hovold , Martin Kaltenbrunner , Martin Kepplinger Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <11e0b313-f8c2-93ec-0324-24b30053a586@users.sourceforge.net> Date: Sat, 20 Jan 2018 22:30: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: Content-Language: en-GB X-Provags-ID: V03:K0:CXKZYhKynZoOG4r3PTmZXtcD7Se/dyyt5MeyH/0J6j5LurtbDYI FSEO76VCpJaC0WgkMvnjqcJyXwpWf93TH0lgBou/T+/iuS1IHUPUzLr+m/v9pzGmPBYrmGw WO1vZq77S5e1zbE/8O53UFVmAP/F9PihBvOO7yjispxijItd3GhmycfknlGeIA68I0d9CH6 kCThH3tqtEJ58Smw5LgOA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mkUFTGNyI74=:PYSGWZhDEnH90nNpWVozfv j0CRc+CZDb/1kuHqgzL/SCZBzsSmbMYyb8W/++8mhdk+cU6t2PfqoSAyJCK7BKe5jQIZmT20g 2561Duf+Ah9dniuqL4raSzgqUV9L8UUr0ZGC4oTNjseYafb7+r/YoUugOyVl6gYiD6XBbLW7g HnI0MwtCd/TqcuHWzqGJH0c3eiI4NWn2I/kym1wrZaKKeW7EpPIMMD2K77NDXXWvSQLRDcYyN 2FAQoXOMSWBQMrgXjvJJLR0R2xpJtyx33gkIfF53d8VENJ8CLLCAIS2f6l9xwF5wpAoMHIPbt tSocUkWeNtOyD34OMc2ICnh7iW9Wm6UHdtXxSX5FGpOCZnw60nsHpcq/jshj+IfowEXkrCZKx JYaVscwWUt/fzodf6qbC2f9Rfs6HFxN87kwDrd16MdFjw+rvNSsHCKWkaQ1yRe3k6cv5Da+k+ vFZw99tAnhrcvJB0EuPj0Z5trknoLs/5u/BoBh1QSM3AtYDWYrok1lFcHPYiEhYDiNYsSAJrZ 6qhIA30fHg6LjLmvQl2hY51EpJOIOlEfLr16fuGeLJR3ssvsgEbCHtaVqMY0iAH6fn9fCg492 /JPPZhUaPSTpwSLFdhG0CXI0LXR4HN5zhHnWwZ5fVcpJQOz5m7z8thBRIAV2j6hLLf2NZ6/Vf pzvHhzSI6BJSGZPDrIgP9wQIxdqaJwhWv8v0RYjXxnZb2EGLibTxRl9Dh5aM/GgtPMQq7SYt+ G7MU/iXnBGKGHd/kQzCx2SFE/Kc4EYm47Su0+BU3SPZGH5lOGnSNcwsYFKQJykmR4aJknTq9/ 9PSY0IvPjkoDXZLha99o9UmNdUJM9+DyGCuLXV09K21Ly2XaWw= 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: Sat, 20 Jan 2018 22:16:14 +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 Acked-by: Martin Kepplinger --- drivers/input/touchscreen/sur40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index c7a0a92b2044..946e1a0328b4 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -550,7 +550,7 @@ static int sur40_probe(struct usb_interface *interface, return -ENODEV; /* Allocate memory for our device state and initialize it. */ - sur40 = kzalloc(sizeof(struct sur40_state), GFP_KERNEL); + sur40 = kzalloc(sizeof(*sur40), GFP_KERNEL); if (!sur40) return -ENOMEM;