From patchwork Sat Apr 22 21:24:23 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: 9694497 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 9D0C8600CA for ; Sat, 22 Apr 2017 21:25:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CC9226E69 for ; Sat, 22 Apr 2017 21:25:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 816BA27FC0; Sat, 22 Apr 2017 21:25:13 +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 2DFFC26E69 for ; Sat, 22 Apr 2017 21:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427176AbdDVVZL (ORCPT ); Sat, 22 Apr 2017 17:25:11 -0400 Received: from mout.web.de ([212.227.15.4]:64505 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1427175AbdDVVZJ (ORCPT ); Sat, 22 Apr 2017 17:25:09 -0400 Received: from [192.168.1.2] ([77.181.100.232]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LtFVL-1bzEp70dQ3-012nQM; Sat, 22 Apr 2017 23:24:26 +0200 Subject: [PATCH 1/2] dmaengine: s3c24xx: Use devm_kcalloc() in s3c24xx_dma_probe() From: SF Markus Elfring To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Dan Williams , Javier Martinez Canillas , Krzysztof Kozlowski , Kukjin Kim Cc: LKML , kernel-janitors@vger.kernel.org References: <930f0a6c-bc5c-3d01-6814-563780fc90ef@users.sourceforge.net> Message-ID: <9c10b823-f49b-8c73-2bf8-0fd2b0ba0231@users.sourceforge.net> Date: Sat, 22 Apr 2017 23:24:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <930f0a6c-bc5c-3d01-6814-563780fc90ef@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:HJ3PoyiUmmidNTyDD+3jV1k1pwMnnKR70DZyd+1oFQCY+CnNOYl XTtU/DJUE6WJrStik0QVgy6UIDCwqJFpIiTH2580SFJ9g7IK6LGSiOmXnJghKOWhWezT8BM SopBJiWg4p05v7Cn7Get/vq3U1IxsrWlHJgh19JpAiypZg924zAHk8WMUA9umkKklO3Jza4 NTk9qBA1voST8QJARQFzQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:f9ISrJMRQwk=:IQVcRWxOC94gYQeYkuUhH9 edwUK9D86nFkLR8ruxjK/1ZEO5FByrrkuCJOIrazeTXYZrbDqk8JwGKzlJpUR0YbxA4ZPTm3+ XuWDMKYZPAeRRap55X2V2RY7T3kpU2jY/69XCkNiNk7VPrkDsRT3DtVay/poqh9Mqp93zRgkU 1FpZeAMIb6dY6ZIJ7nbdP3bNwnUNqPau8+qGBYgRRVki5ZW8nGsCkmP6VtaMBE+sm0RsAhgI5 SoMI4zfhR3CK9F5S+cMbQ+KE8rxtl6dCtYG9sV7BdTV0SX1eemyKVp70Rb8epkccQO81z89Fe Criq0t1hX/v+p3GbzaMweflgsIQoJiHpF/6jf5+Tt0vXpbrb04zfKmkfEy0JR58Njr0M2PVHl Dl2iHd6Udzil3x3d1KzOgFbtfup6JOnraRsB+BP2HxkvMOw12VF3t1BoTEsTTm1spKgaqD5ny GcWXuhsRsd7M6DyCdCZpHS7JlTgn7XwgEY1fn7Vj0lgMrX9SX+xv4XfDVm6ctF5L48FJk/GZS FMRy9VDoJs529LFRut6o+hGjRijbuEpiZ4oF7mD7OJe1hP8bCuJw4NFVlv8oZfV0zpZOwJfFu Nv4q6kb9jmUM+d5REqhOR+w1bYgeM1872V04XxBQhjZO2FNjeMqLYke76SLq2kMOaRi2R9L9S wLMCn9HQq19nCQYe0sctWYys7CJvhy9VdPW70xf2Xp9ZtNozVhdiacL9aEiZA5imHbC5R3Vcb Xhp06zoHjk02A7zWI5QNUJhJhrOnZaC4IAtaHjt7/+6qcEe/uh5WmLbVxPbsb1w0+WR0Iew95 cfwAgOI Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 22 Apr 2017 23:00:23 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". * Replace the specification of a data structure by a pointer dereference to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/dma/s3c24xx-dma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c index f04c4702d98b..967229829683 100644 --- a/drivers/dma/s3c24xx-dma.c +++ b/drivers/dma/s3c24xx-dma.c @@ -1216,10 +1216,10 @@ static int s3c24xx_dma_probe(struct platform_device *pdev) if (IS_ERR(s3cdma->base)) return PTR_ERR(s3cdma->base); - s3cdma->phy_chans = devm_kzalloc(&pdev->dev, - sizeof(struct s3c24xx_dma_phy) * - pdata->num_phy_channels, - GFP_KERNEL); + s3cdma->phy_chans = devm_kcalloc(&pdev->dev, + pdata->num_phy_channels, + sizeof(*s3cdma->phy_chans), + GFP_KERNEL); if (!s3cdma->phy_chans) return -ENOMEM;