From patchwork Mon Sep 4 20:07:24 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: 9937573 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 E4C9E6035F for ; Mon, 4 Sep 2017 20:08:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D890F287B4 for ; Mon, 4 Sep 2017 20:08:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD74F287EB; Mon, 4 Sep 2017 20:08:38 +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 86717287B4 for ; Mon, 4 Sep 2017 20:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754553AbdIDUIK (ORCPT ); Mon, 4 Sep 2017 16:08:10 -0400 Received: from mout.web.de ([212.227.17.12]:65235 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754531AbdIDUHd (ORCPT ); Mon, 4 Sep 2017 16:07:33 -0400 Received: from [192.168.1.2] ([78.48.84.177]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lrb3x-1dKtnf2Nm1-013PCZ; Mon, 04 Sep 2017 22:07:26 +0200 Subject: [PATCH 2/6] [media] atmel-isc: Improve a size determination in isc_formats_init() 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: <2b909a2d-0986-fb5e-f2d9-5d9c0fd71a06@users.sourceforge.net> Date: Mon, 4 Sep 2017 22:07:24 +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:6C/LxDkw5wUY8KL8ORtwjKtMsNRxtt4wnnUn1ZU93hrkMS2O30w oCuk4pvI5urvKtymgpGe9j4HvdGnyBAXhJV/BzcRDNAdt13YEzPiYvejCUqjCsCa8eIpsvn mnN/AAD7XirUVuIk+VHKRv2lw0thlIko1x1vRYedD4ZVmy/AkLWFIRHDpKDxB+8PQ0+mumF 19n6a2COZqX3IQ5LmhI3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:EKk533373gU=:fOTC0S4OIvPTjCoDfl0tvd TwygQoA/TlTwBx0c1plRvkjei6EGFaSedLuWT952Gie22Be3n1gJ/0QglhrL60v7H3liXvQAZ hp377+mvK2UMWE+mYzdqxqveAzk5UY5Tq7CwVO9v+ThgiAt7Lmc7kVE34kpwRT5zU/dMavyvO 7VaBadDIhPNyYcqcFs//LpJO7YzhNFKHfBd7K8buW7MXhJj7Yq/EsbxC2gMk49dfhiQlhVvla I/05gOqNfTJ81+oYOYfFvXlC9SVUGqrLcFovMyqFxOpahxcQJqsrYpmLjst2mfX7b9qX4BO0e pPhgUbtWR5X3gsUcI3MNICDS+ijxLv94ngRk7HkzLqFf9Rr2iFFGeyeHukg1tDbqucZ2FmClY dI+5cEmzLL1YwXUw3KvHCZFZtkxdR0XaAxMscM+I/3c5N9ayMegWfmRe+EatWtQQ2i5B5xnhG TeB/O5D+ZiIUTFk9082vyGbAlKHxJ1HFobKZhZq0ow202y3MvB7qs5JOIupHTl0H7WFUAS/FF 1nskRJwRnKTPx/4mZXNWShqf3lNST+6u+DAYF2FOVO+UhJ73nidoU33dH/B6HT+VQgciQ30/J +gYT1y3ZGUVtIE7fwZE+sxSXgovVwwDUaEJ8wHCEufmeVGnOiB9FuSFfLSJzarq8otsSzOIKh k5AQCLZt0ZFW3bbskg7BpDEjOHAM5hOVF3HJU/4gjhte6rMVIeyyyhlMPZqvZYdK1NFo0hw4g ZDRFW0nnZlo3a+nQcWN1uGCeoS5FB73O1+DKe/MBzKASylbISUuYMu3qcgfsxGGUrEhJC8yHI MhnxmdQhyNoI1SxlPC9DSNVPm8RZ48QDggXJUlLyM+A7sUBBFo= 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 20:50:22 +0200 Replace the specification of a data type 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. Signed-off-by: Markus Elfring --- drivers/media/platform/atmel/atmel-isc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index f1e635edef72..f16bab0105c2 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1505,6 +1505,6 @@ static int isc_formats_init(struct isc_device *isc) isc->num_user_formats = num_fmts; isc->user_formats = devm_kcalloc(isc->dev, - num_fmts, sizeof(struct isc_format *), + num_fmts, sizeof(*isc->user_formats), GFP_KERNEL); if (!isc->user_formats)