Received: by 10.223.176.46 with SMTP id f43csp1215538wra; Sat, 20 Jan 2018 13:32:11 -0800 (PST) X-Google-Smtp-Source: AH8x224uoK+gM5n29jbp90la8Y/25cewtYfIFuUPkBZrGrAumQsCRCoebWVt2jXHcmB7rkhOM6bw X-Received: by 2002:a17:902:904b:: with SMTP id w11-v6mr1370955plz.41.1516483931039; Sat, 20 Jan 2018 13:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516483931; cv=none; d=google.com; s=arc-20160816; b=HQEN75H2+Lch9lr7zLdcxRuA3CEsn9I58OhysuiqmG0ZkBwg4h0BE8p3N9PngWFo1d lm6hROc74743ENRcD3etmZxxwD/4x0jZ7gQwWiy72hgXOLY7SykJmoe1pJ/C+e5jE2Vq bqm8nagWumsIC7B97rwjy9O5lfyB1GIWoqKRMd6WcPGM5giCddiWJlNwHsRUNQG3F+as lpjw/9ukFcXYi8TJY49XTE5iOeUl+EVaivhFPV0BHuTRsl3IIYGF6mogqCjrgMUC0BWw BXY+F4PsGXPuJrLU/0cxzgiXaL+zWjAsgUBHaD9YTiHROtn2JnV29X05xJdDv+HKhOcT yrrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=vmFPsYwunU0vB7m9wh+CIIoQK6gi5xyWP6yimzwY4eI=; b=YG/DR0PNd5T3ufnkU0gjNspYWGX3v1JGemkPKCTxAB6erVNoP4Z1jKoH+qadL3bpqY GJ0YYUqJizIbI9Rb6gl1y4/5zfpEkUY2rxwvgzVrkTVLLy0DlWLKnT491Suj3JlNzfio G6AO+vU5e9N8G/w5BK3GDv0ywZu51WK1GPqtAUEk8D++8CRnQA0de3IDpndPkDO7gHaZ j7gYo4Oe7ctDETajLfX/TFuMl8YtRHosPwbxcL9i25u0uBtgpI740fp3H0tHa2El0jXw R1j1SZ2WHnDvonTMw1w9avAFgftG8ZgRfdJZ7hLZ7fxL3clJBC3PK1AVcZx//q2CF8mc SULQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si2009366pln.6.2018.01.20.13.31.57; Sat, 20 Jan 2018 13:32:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756771AbeATVaU (ORCPT + 99 others); Sat, 20 Jan 2018 16:30:20 -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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.15.1