From patchwork Sat Sep 2 15:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9935627 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 6C6F260216 for ; Sat, 2 Sep 2017 15:52:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 608E82863C for ; Sat, 2 Sep 2017 15:52:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 551C12863F; Sat, 2 Sep 2017 15:52:33 +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=unavailable 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 18FAA2863C for ; Sat, 2 Sep 2017 15:52:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752728AbdIBPwS (ORCPT ); Sat, 2 Sep 2017 11:52:18 -0400 Received: from mout.web.de ([212.227.17.12]:64447 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684AbdIBPwR (ORCPT ); Sat, 2 Sep 2017 11:52:17 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MWB4X-1dzP0I1jz7-00XIs5; Sat, 02 Sep 2017 17:52:07 +0200 Subject: [PATCH 5/7] [media] ov9640: Improve a size determination in ov9640_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Bhumika Goyal , =?UTF-8?Q?Frank_Sch=c3=a4fer?= , Guennadi Liakhovetski , Hans Verkuil , Janusz Krzysztofik , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <5d342b6f-8283-c1ce-5469-fefeffcc05d4@users.sourceforge.net> Date: Sat, 2 Sep 2017 17:52:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:CjWhcSUDYCACuxLIMWd+t/67pKcf59LGfXABIdATHYewxMgbTHD Z4h5Nm1yd/zU3GMDkslakgdg67xAUgfWu1KIAtQzvq8IahtJltdWNsNbEQe2H1v2JU03HTP VYE2UkhI6uzFoNEuIJvNPJmvk4Q8LISkFKs59UjZRsbCUicEsi6a3oE30pz+YbOIPqHhNxr eLvKMEOeaP8USVeRKly+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ll2KcXUe2CY=:ZUR7qD4PQSQOC200LCGM13 SW12MnAkG8+i1WC8ck+ctluW1SEn4n49vcqlHBSJJ+YeVYg1DOa4IGImaXr+37g2Y9Ij2iFN1 mphhcQKZ8p9CQdjqgh7UwYsCLnNMB7T9NoPkdbbcKg2q1/dNkf+0Dbpxl66YfKB96hLTt2UhG PiDafVOaP1ag1nd+7BEnToXGyK22jbk3K7VLqakVJtDRKkDkqm4adIT8nMqoFmvYM+/K9sMbJ y1W2HKtuSMUhAaVq3et6c3FxLctnmQfBbZWsUzKq3EH4s/bpGS62C0l9eRr0VkjZoCQlSj0oa cdhS+5LklgGRvsF7YewzfnyCizvV+jOBTlUbfRHmytxlmHGIeUI5P3FASf7IaPDcBgeqJadQ4 SU/pYwPMaaFVsrMVHnxLDmnVsq8VslLteWuOCeaCHXcGeImAalTx8HXNIqkXuPt6FTlaDw+WU DtShfwu8VYSgqgb+sy1MpRpIikFQ6m9D59imv9A5EDqOE8WJW7+KkHkXchcfJN9+cvI74n2d0 HnB0DLQU6Tf8JgmZgzoTkXzntfJAbgYyBK3TQvueG80HoAlKoKZRb2HP9FHq6i04GPxdUkLVO 2QanAZeVIY5Om8zX83YDZay5kT/j5Ai+Wr8XtzDG1gV39tby0eNp5xoTC571iT76OlcRkKi6A urorpB80cNWo6D4ZGrjo46x3azLzLGGXBBBpR2splQSQ2OtVBYe1MBWnBJ60vvMRGQUY1rwew Vv1nMnHCM8mZ5xXopEvphE3LcTMkux7pmaX4hiRRjkLhgLIpIt6sYFAAtTfGIzYYdaZwlfUky qHVsjdDKE1+61/FcJXxGHKjEw9BUFwYPsqIqJ0/LBzaMB/4vo8= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 2 Sep 2017 16:37:03 +0200 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/media/i2c/soc_camera/ov9640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c index 0f02f022f3e9..67578f194928 100644 --- a/drivers/media/i2c/soc_camera/ov9640.c +++ b/drivers/media/i2c/soc_camera/ov9640.c @@ -675,5 +675,5 @@ static int ov9640_probe(struct i2c_client *client, return -EINVAL; } - priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL); + priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); if (!priv)