From patchwork Tue Oct 3 20:14:20 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: 9983441 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 D4EC460365 for ; Tue, 3 Oct 2017 20:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCCAC28A03 for ; Tue, 3 Oct 2017 20:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0DA628A0E; Tue, 3 Oct 2017 20:14:59 +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 7A17B28A03 for ; Tue, 3 Oct 2017 20:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751384AbdJCUO5 (ORCPT ); Tue, 3 Oct 2017 16:14:57 -0400 Received: from mout.web.de ([212.227.17.12]:63264 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184AbdJCUO4 (ORCPT ); Tue, 3 Oct 2017 16:14:56 -0400 Received: from [192.168.1.2] ([77.181.6.116]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MduAD-1dgR9c3sq5-00PcsI; Tue, 03 Oct 2017 22:14:22 +0200 Subject: [PATCH 2/4] ARM: OMAP: Improve a size determination in two functions From: SF Markus Elfring To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aaro Koskinen , Russell King , Tony Lindgren Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <8735e7ee-a744-cda4-005b-7a32075655a5@users.sourceforge.net> Date: Tue, 3 Oct 2017 22:14:20 +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:CE5Dj7QBOXiWhoMyJJBTRMRsstVN1QHtEEtqMAFacqHcFLxhOu9 1kzmNIxMvIlbkNkeBuLTxFPDTTsjCE6S6kLEvFwM17O4AkJ6iPif7WlTLF/sOjMRMDh8OqB c37gFNyS3JSFIlPX0HIfGZUNrf36Ue78nED7bVBpWZ5dj3I3qwUeJzS+rhAHNqke8ivlwdR CSvt6aNV3xJJwgduMbxoQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:FQ+fgvbyi+I=:+OJOb+GxWF22S7/iXULzhb 3k1I3FpE1p5s5YloTu+3uy2UAc7sLCM6Zyt60Qk5TYKzfU0qUVFdg+FVVnlfMa/59VeVf8ZhX d6t2S7OKnXY8Js5N9jeyXNSckJ/9J4a7M9m4BwPsEb/ES59VP2z+uWSP0a1Mf0nmVgwQoQhpG CLFeZNY0cboytgRhGvWyVMb0vnrH41U5ysg4PNEmH0FWU5XZiJpEzlNgKQo4aVpYi6lTQuajL TS3LF+Ebcv+RKlpNw5KzwrPBAEtzmlu9vLoCJEPzVXu0YK6ixMVXxVhq7G9gCktmVHhEcx0Vl AB3i86g0q/UAK7/WcwEXOP5ePM0RnoVdxZcTvahwjWhTlsIqLloHWxglGGB/r3FwhEGPg42MQ 2nGwTR6yHPIQMnp1EUjn4dgfZylEhA8Zx0+LfFmjVYF29Bh3X4P6nkwozbYhk/Ou+pvFXPpG+ 7tJQOdPmxeg+T34DwJIw4v3/7Uj6G40NnLPKsUE4edTTHa0ZImj5k24yw0VXgRbCce5IHEzDX T1Mz3WV2hx1GUk9UumHIalLuSbpQoKmJT2X6/eb+rTjgiv2TDceGI8XmIuB7sn9JsO3j1ivus 3TzrjZGg0hHHK3GxCHz1qY3I+EFwlqkLXGe6sV/ZP2+ZpjKarMtCbUSzGORif5n8Ixb3JDuus f6sTWoi4g/ROji2CROz9cFcFb6ywaUqAm5QOCJe9cog9kHlsvom1DfZLFTpA90U3ePgzb08sx VG3g22wD7oirRcDR8LwLCObzE3iIlQMyCrFTJ8geTU5sXN3+aA+e0SL+fOKH+aokBcBv1qo5o GqIDv7AEJh8QRJC8qmaD/ekiPBrwNcSeBU3Gx7DG1UrYzIUjs0= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 3 Oct 2017 20:46:48 +0200 Replace the specification of data structures 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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/arm/plat-omap/dma.c | 2 +- arch/arm/plat-omap/dmtimer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 6ede0427548c..409e4ecaebe9 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1316,7 +1316,7 @@ static int omap_system_dma_probe(struct platform_device *pdev) enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count, - sizeof(struct omap_dma_lch), GFP_KERNEL); + sizeof(*dma_chan), GFP_KERNEL); if (!dma_chan) return -ENOMEM; diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 446ac0e3a35a..14779d6f425d 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -857,7 +857,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev) return -ENODEV; } - timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL); + timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL); if (!timer) return -ENOMEM;