From patchwork Sat Sep 2 15:54:06 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: 9935639 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 094CA603B5 for ; Sat, 2 Sep 2017 15:55:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1C9728640 for ; Sat, 2 Sep 2017 15:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6EBE28643; Sat, 2 Sep 2017 15:55:19 +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 9AA7A28646 for ; Sat, 2 Sep 2017 15:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbdIBPyY (ORCPT ); Sat, 2 Sep 2017 11:54:24 -0400 Received: from mout.web.de ([217.72.192.78]:50408 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbdIBPyW (ORCPT ); Sat, 2 Sep 2017 11:54:22 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lmu2K-1dI7my38ZQ-00h4ZR; Sat, 02 Sep 2017 17:54:12 +0200 Subject: [PATCH 7/7] [media] ov9740: Improve a size determination in ov9740_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: <45f7c20f-054d-4542-88cf-44981ba61ee4@users.sourceforge.net> Date: Sat, 2 Sep 2017 17:54:06 +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:xzIWJYnM1PoRQwJ+Nf53RLQ7HzVVXWp+3hg+o9yc1Xy9IcA0XP4 yxndtbFmSlAGu9iRuq5PfyB4KXNyjjm3GiIcelZ324XP4QeXknunH9/7lZ3e9citzB//qn0 n0tQttQLeuM1pRAibI8ycPgYJ+kR7kgcpwTwYJsdTdPldcUfHmQRISJzJSLYPkeQYvwwd/z Ga4KRcc2RToKo7gVzYpmQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:yC+vihZUovk=:CG3EXdIPyDtXfl8JglUhXY Dzwe/YGYMWegbNpHQ+dDalpA55cM+f4lqcfOHxQtz3ifxsATjxw1G9EHpNQC+rSsCOTIX5sl2 l4Bkux+oZDzXfrRsVyvS9mkOk11GEvSFwNJPMoBhUoe2sZWMFacKiLhXmgKbZzzaUrzp252zK bZjsCAeunQRgD7em+2hwlCTBASL8saviPkku1wzUg5j9RZkffYmnliFcRgJWCCTOWCYUR5H9j nAxT/Vb4/SZuogGoYo0JEi8gZd4ornU3ywUxc3aCtHAIShzhW08fjL8mJxe/kRsZhwzx5rAQZ hC9bLRlBAOZ0NVk6zC79xFUNzy3EOHmFj45b3NPN1cLaxVa34bO03E8grzWRNcyXL80ZuwiB3 C00lihyTcQeDfcsDNsfCsbz7FGFDLg0K2WNV7Us9OdxoR+7/DJzniCzDCYa7VVLEkqo3aUtsl xBAUDda0se/lnkG+AN36z9qWFrmY2WepBIoXom3auOgnoy4IYBQ3wSbbD+ieX2xQO9ANcUosA T8uFjf8iIqZrBSH09sP/dVQvSkQAe/Yrc1xM2GkdDQfxq+pHAZLAItEHaO5zf2eHLjGl4eB/g K7shtuJ60uNyPPLuYARv7wlSlG+PZYsHIYeJXpHPN6CdkSe2kLuqDIvbkGVuBCqn5CP78qGL7 XGuFLm6TeBWNpi3A1SOUxkRYeGROrGZT1P6fz5fZGEWJhHTswb1OwBUriZuODuryNKWvCTheL q8PG6iOGe6iee3iNRKXkxX9s8oYRSZYR9Q2UPabD/QJY1mkicBE8kkuhnANVBrAFD+2Qk0eIu 0f7IILq+cUfspGNHcJlNFBmw+v05EUaJxnAzYdUxg7XVUFbanQ= 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:46: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/ov9740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/soc_camera/ov9740.c b/drivers/media/i2c/soc_camera/ov9740.c index f44f5da795f9..755de2289c39 100644 --- a/drivers/media/i2c/soc_camera/ov9740.c +++ b/drivers/media/i2c/soc_camera/ov9740.c @@ -935,5 +935,5 @@ static int ov9740_probe(struct i2c_client *client, return -EINVAL; } - priv = devm_kzalloc(&client->dev, sizeof(struct ov9740_priv), GFP_KERNEL); + priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); if (!priv)