From patchwork Sat Sep 2 15:49:28 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: 9935615 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 C7DF060216 for ; Sat, 2 Sep 2017 15:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAA8D28632 for ; Sat, 2 Sep 2017 15:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE5832863E; Sat, 2 Sep 2017 15:50:05 +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 7572128632 for ; Sat, 2 Sep 2017 15:50:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbdIBPtw (ORCPT ); Sat, 2 Sep 2017 11:49:52 -0400 Received: from mout.web.de ([212.227.17.11]:64243 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684AbdIBPtu (ORCPT ); Sat, 2 Sep 2017 11:49:50 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lp6xk-1dKK6f1u32-00es7s; Sat, 02 Sep 2017 17:49:29 +0200 Subject: [PATCH 2/7] [media] ov2640: Improve a size determination in ov2640_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: <457f2678-da7f-cb67-8893-5cdb7ce804dd@users.sourceforge.net> Date: Sat, 2 Sep 2017 17:49:28 +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:w6/9fSZci1+X8j+JLEizvd+pv5EpKaOor8P6+kae3PAeO5lyNsv j3HjHPiBlgYeRY1LCcr50KrIZfdHZEYOiHT2hQSlg7QhVglRXVhWA1zHu2fnvSrSg+BRZtw oYCGBltijS2oVMAPidefuz+F+MQtkKIn+4kb5FWsyDtSeiodNp9mOdLFildLYM+e5DCzSc/ /Ch2KUxLjYPpLguSzosMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:4whs+jPzrFw=:9gpcx5QZYwjZ22tt7JNhHh gy22yx7nof2MR0Wnin8J9h0us9zAjQgCdirrTARoQwuxX0DaHP/DvAaMxVcXqvggCiHSpMQBV XfaBUC+4ps5gOeBZHQHWvUdx+rrR8W4+BEDkD+P/AQkQ1FUFIi5DzuR/mXHBpAImiqoLGZ4d6 fPdvvy5sH+vmDvt3rO5juScyF5SPak/g0qJgJwQO0MQ7kX9oQnV4rwC9jcmM+szya5nNSbMu1 uw9gRUC4GwPTKQ7BtTcwVCVnFoHFtD1Vi7ZuH53NVcSYHlrDJQIVePq56ADytynV+nDJg4oMV gRB02qdhcQ8DKoO48syLwTgdE1a7SCpuALzXs2J132A5DBmSiaQQ8zBrYkujIRjKtS0DqXXMp I5DmVJAhJpqbRqyLtBRGCk2Vb/ArCr0nhiPTEEkSB4wMQyS/xjV9L4dOHsefyu02qfJWdnGc8 5VYxxk/vQAgEI4dKP/5nnHLCiAm6ED4qq1oK0w43jXOrGbZ1Xg3k0BeBWnndxzMo1qG5ScKvj 8X0PmYnBNfltZzCuUxHBTqirIg2MByeV04I6acaOZ+XAXSVmhQiSOi9QIMGPGnr+YUyWMdnU8 6WjxKL077H7vrJe3NHPQXr04S1oHqlj1PJOfBPaPbmFWltcffvuVg1UnSiiiTWDIGuiLK9KfD cFWsC6Ykw4zf7AS5XEm9ANnr1T/6q8B7KSGFrmJ/qGZLgEH9ljY7Xdb8pufJw1NsLhgPBqfDa yavLmDjDMsYs+QzCXMGpS9GM9vQ1RIzfvXIprcLdxeKHnEyaoURqB8Zdzli1gEIHSs7DB8UIO 4+vC5OF3Oh34wtRKJdJ9Rvn3Qp7cr7tgtNhTT2W0xW6LfbOQXg= 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:09:35 +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/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index e4ae53410097..456aa977bce8 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -1097,5 +1097,5 @@ static int ov2640_probe(struct i2c_client *client, return -EIO; } - priv = devm_kzalloc(&client->dev, sizeof(struct ov2640_priv), GFP_KERNEL); + priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); if (!priv)