From patchwork Mon Sep 4 20:11:22 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: 9937583 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 890F16035F for ; Mon, 4 Sep 2017 20:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BA02287A7 for ; Mon, 4 Sep 2017 20:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F66A287E5; Mon, 4 Sep 2017 20:11:53 +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=ham 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 283D9287A7 for ; Mon, 4 Sep 2017 20:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754733AbdIDULv (ORCPT ); Mon, 4 Sep 2017 16:11:51 -0400 Received: from mout.web.de ([217.72.192.78]:49520 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbdIDULb (ORCPT ); Mon, 4 Sep 2017 16:11:31 -0400 Received: from [192.168.1.2] ([78.48.84.177]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MGzXS-1dl3hB2Rms-00DkWx; Mon, 04 Sep 2017 22:11:23 +0200 Subject: [PATCH 5/6] [media] atmel-isi: Improve three size determinations From: SF Markus Elfring To: linux-media@vger.kernel.org, Ludovic Desroches , Mauro Carvalho Chehab , Songjun Wu Cc: LKML , kernel-janitors@vger.kernel.org References: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Message-ID: <2a5b21a7-91af-238a-0064-e382fb85afe3@users.sourceforge.net> Date: Mon, 4 Sep 2017 22:11:22 +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: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:C3YnsZeK4c02H+5cadH23sV/Vyxt1XVKSi6MCilNVfVqzd05Tw4 9KXiKB771GUp/KmrbGCg7rSYyFtfWkG+abcfXsfDStMez/SOJL7fVdNAMVQ9xpL3bSdYYnP J8+C0NIT7uYojeupuDV5YMxrbLMjKTdMk1P1gvz4lG35dWK792Ux2/FLf6eWSLFxDPcet9m uI8gPtBUlHo3OVekrqkng== X-UI-Out-Filterresults: notjunk:1; V01:K0:YYg9G5LsSbk=:MGhen8tPEUgt6fQQozJMNi 67urIlz3Suyn0CzhF5k6Y9Kp5ixNtPstfAELEettDVPsvf/dw/4OfcaBdOmFDA8dHTYXEoo6x cCLNvoo21JETu6AhhYzthJBATwzhz5CEIfgyh0UHQ6sxiqwHo5kXuRAJQGBl1SnNos6yMVOF4 2uhLvr9bPzbY9T6ZJ8fT9UCzfhuLtkvfsjgD84IDV+1/+oLhtiFhCiK5ZdVjQuecl4tvyEDgh dLlGLrWhYYy6GDiqhGRj+nxU1fgoa5qHQ2wIOdtpMHENGsXc9hDB7gErz9Wq0pZssDgXzCtB/ mL7gr3RGbSm3cA9Oq0yR30uPrfvA9EDO8gzg3niF2UWCy3CqBHH6tH73DgajSiHyHY+5GoZKC N9zbB34BsQsl5DMDwb/e47MEPr9MGJ68nvMSXHp6Xf/TndZRP5s1CE87LHzCAuBIAvH+EyxqA vc7YhJV0xDw9xSeo9nvbSiuFclYORm4nzGAFKWk+ayZNJxjJrfvcRlVoaEz1N+PMKqOcAezsq Xms2GBOAATC9Wq//Qh66P4WZUbCpSrhfmTlOios0OGSHjNVnR8S/jC9HgQH8uyKCyRbVtgeP1 GYB5MSmpWDJGFdtDnGIdzHLx1G5B5kIyNcL4pxFJiUBCqK8HSDsE7KfnYTqzPm5x1YAzBYd2H v4UaB/ORdlZUaD8ecqlP4jgMx7wixLOA1m9JhXY8TfB4Ieo4urQufg3KR//1ax3oMLEGknIL6 JaVbzCxkwi9gYeTleCRaAk5cbIR+41Bkt6G3KTK0xf/xZGU8dwWmLltMHGjuFeZf4La1e+DG+ CkvuEtfv6vIJEwjPTke/K8qgHnBdUeD9SSGnXlTSBr3DTIq2Ts= 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: Mon, 4 Sep 2017 21:27:45 +0200 Replace the specification of data types by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/platform/atmel/atmel-isi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 154e9c39b64f..ac40defce1e7 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1036,13 +1036,13 @@ static int isi_formats_init(struct atmel_isi *isi) isi->num_user_formats = num_fmts; isi->user_formats = devm_kcalloc(isi->dev, - num_fmts, sizeof(struct isi_format *), + num_fmts, sizeof(*isi->user_formats), GFP_KERNEL); if (!isi->user_formats) return -ENOMEM; memcpy(isi->user_formats, isi_fmts, - num_fmts * sizeof(struct isi_format *)); + num_fmts * sizeof(*isi->user_formats)); isi->current_fmt = isi->user_formats[0]; return 0; @@ -1173,5 +1173,5 @@ static int atmel_isi_probe(struct platform_device *pdev) struct resource *regs; int ret, i; - isi = devm_kzalloc(&pdev->dev, sizeof(struct atmel_isi), GFP_KERNEL); + isi = devm_kzalloc(&pdev->dev, sizeof(*isi), GFP_KERNEL); if (!isi)