From patchwork Sat Sep 2 13:10:13 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: 9935579 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 C15F6603B5 for ; Sat, 2 Sep 2017 13:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3CD32853B for ; Sat, 2 Sep 2017 13:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A908F28592; Sat, 2 Sep 2017 13:11:17 +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 2C09D2862D for ; Sat, 2 Sep 2017 13:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752722AbdIBNK3 (ORCPT ); Sat, 2 Sep 2017 09:10:29 -0400 Received: from mout.web.de ([212.227.17.12]:57930 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbdIBNK2 (ORCPT ); Sat, 2 Sep 2017 09:10:28 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M5OUd-1dZUe33mHP-00zWeF; Sat, 02 Sep 2017 15:10:21 +0200 Subject: [PATCH 4/4] [media] adv7842: Improve a size determination in adv7842_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <0e67e095-4931-b78f-a925-7335326ab69c@users.sourceforge.net> Message-ID: <0ffbe17f-7de1-a456-a066-227f25642fa1@users.sourceforge.net> Date: Sat, 2 Sep 2017 15:10:13 +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: <0e67e095-4931-b78f-a925-7335326ab69c@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:xXUj7M9grT8ck+BMtPvkhWAb74ksK6ZspsTzDcFHejj4CoZfRAX MUEtcLYpSCrFgmaGScdmoUNLwTZoQeMNTmQ1x+cJJ5X+VdS7hRmUJHdN/ih5ApsUoDeijby bNTlV4Wf2W30LuNDfOsD2/N1f7WLoyR1mMV3smOxY6xvw8sVxU93PXTrwKo78fCVvaxL4Mo Ih1kMcQLqbt5LyvdMG2RA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kPKyaJAbN1Q=:3MywBPlbE3Qi3/3dZWIHsg 9f1MojgdkZGZuSwOyfF+9Lg0vFPSKlcMx7sC2occTj27DHq4s87+vuiUTpSPpIGHLRxpyF5e0 m9dyZwtEEC8hs0X5XzRDfimzIKJ33ReEHRWEPFH63kThjDGF32Si2LeSB5SkpSBn29SunTBB1 N+/B4cjxOC63Z1/IVrMqY/hMRjMPfLkYu8c6EfO+RyYerfkv1yvFXM6fd7SQ2h87yOF221DDM /oguPYfjIOSxy/TfHJ3F/6m9+OL57KIJe3w5wZpP3VXI27OF2drRM+TNW+xK+N93uguKHjAv2 1D3ZVD401MXaRTlsV2gExWp82F3Pk5qq3MYvApWSVrdnAW/qDKAj/eR9mlta/lKzbtDkoqX3w NR4yT3opitn/5pH0H16kprMUl2OFvy731xOWyruSNoU6L7uy9MfKhocvTZGeED8io/joNXi7g cx7h1iIg++M+ouO5bpJEd3AbmBF5OdMczM58rUaIARgM4MisXtgEsb/TvgvqlgfslTyOXwb24 ot51kQL2averde03+D1j+HQaOzcCIBj9w6ZPZma5NSlrVeSus3Nfl8VEdNEZR6CLMKEqouU+j L7g9vbrttOc2YsaoxZDCD6yZX+ZwyKUZcieo+VbgPvJkLI0q+09JSfu6MmvGhl7W0ES09Zo6o aZ0BCAipyOYC16fcK6PvJOu3704Zzoikxu6gAYntk03zN2V2hn1DCaXTCTSOYf+Szi1GvGnr+ i0VO09+qqw3wfInb6pc0wg2LyzmQQ/Arf2OfcZnGsADz+OpSOQAeLsgj4tA4KpXjH7ZLvmhnU wFmEDXpykzE/hjwodFhfx9/YTq+9BZZWgwyGspOmKiGDTuoUGg= 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 12:53:15 +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/adv7842.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 366a294edd7b..aa8b3bcdd750 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c @@ -3467,5 +3467,5 @@ static int adv7842_probe(struct i2c_client *client, return -ENODEV; } - state = devm_kzalloc(&client->dev, sizeof(struct adv7842_state), GFP_KERNEL); + state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); if (!state)