From patchwork Wed Apr 26 09:20:07 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: 9700699 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 E3341603F7 for ; Wed, 26 Apr 2017 09:28:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBEF2284DB for ; Wed, 26 Apr 2017 09:28:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E17284EE; Wed, 26 Apr 2017 09:28:47 +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 96481284DB for ; Wed, 26 Apr 2017 09:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1956299AbdDZJ2j (ORCPT ); Wed, 26 Apr 2017 05:28:39 -0400 Received: from mout.web.de ([212.227.17.11]:50373 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2995362AbdDZJUU (ORCPT ); Wed, 26 Apr 2017 05:20:20 -0400 Received: from [192.168.1.2] ([77.182.112.5]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MGiUP-1dGlWi0cRF-00DZnX; Wed, 26 Apr 2017 11:20:09 +0200 To: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, Bartlomiej Zolnierkiewicz , Tomi Valkeinen Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] omapfb: Use devm_kcalloc() in vrfb_probe() Message-ID: <4a7b1751-4319-4bde-cf26-2de2a4096c68@users.sourceforge.net> Date: Wed, 26 Apr 2017 11:20:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:EHeH2Y1kns/pV6ksZ9YcFR82RTTfAgdNnqkQ3Neub5eJEFkHTAW VP1oiZ+YPAA6i9SpaEpP9kwhAT7I0jXnnSgqh/8HvKaavvbYjp82eGlqjPDjYWg50TafAO+ bfWiLAgXTSJbBSPCBB6WrBNqRhKQqgRnqqyvr2K0M0E+FnwRA+z2+EBmG38h+YrCsp/CcsP IXQ1VSXUttG5ba3C+Nj1A== X-UI-Out-Filterresults: notjunk:1; V01:K0:U5WeaeBSz2M=:ucJnHjw7NUfiiNOuqOtPFE QTQgjBWn6EYk7MeltMdUOv5ZUjck/4sk/qFVCSkylYw9tFLZUlufggKXDAoK3f5E3okgaFkZX Sw7mu5cG8RJfqPGW8YOL07EQ7Bc8DuGZyUfxFqbv6m71fYEZcy33+9y/m8oLRZEVAe3Bxyb/F EWflXaYI/BBeiukMRksLlKfFuAm7xS6t0LHc+As7C2L3eg3caib8t3aOcRq6HLMlWskzq/3Zu kEszDg1UADncD7epu3KCjqsQF7ldvev0Mz2GjlToyB99EGl7Iy/HAstwbBnWlPzbce8N1lN+L 5Z9ImuJVUGvPu5rFAcA4VE9puUPOYXhAP/PapWg/q15vYHYKN4Bu/vzEhwI7NG5E6NC1jjbjV 6BY7bkywyLlJZ3AKU0a7DgAYKQQrrOOrGXs/p0nYzlOVB+HFJYtrye4XHNmEudGjnw2sBelIh +EubjBYEVh7KmPdF731dGj2FeAyfktBxJvJLuQnawy/ZFIcn7sywfbSCB30+2XzhD3OYix9NF ZN5AuOKNA8ROoDds+HYg/L0bk3xpu+/bx/1RKSykVsTICmoqdJ3jMlNbdZJRMwyVZ0Mm1+hI2 4BQL/YSFpA0zsVVcYdm2bx9gTbRaPnwOyPaGDFkuCDgJJKZUL9tYqgxlT5PyOQbNfrtZ9THsO wbIrGS2XmfviNp2F7pye7hXNzMaBuSnov1zTlXjHcG4TAVcyhZ0kAs5GEMzEk/AE58ZS/qH0S yQdrwFi5Y4s/FVzh3+Q8cOLFGlpgcxvtB6nqWVP0/AN0TQt2p8l/ELQvSWQB9p6z53eipDZwD 1x3dcUN 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: Wed, 26 Apr 2017 11:08:30 +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/video/fbdev/omap2/omapfb/vrfb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/vrfb.c b/drivers/video/fbdev/omap2/omapfb/vrfb.c index f346b02eee1d..54b51a7a290a 100644 --- a/drivers/video/fbdev/omap2/omapfb/vrfb.c +++ b/drivers/video/fbdev/omap2/omapfb/vrfb.c @@ -358,11 +358,7 @@ static int __init vrfb_probe(struct platform_device *pdev) return PTR_ERR(vrfb_base); num_ctxs = pdev->num_resources - 1; - - ctxs = devm_kzalloc(&pdev->dev, - sizeof(struct vrfb_ctx) * num_ctxs, - GFP_KERNEL); - + ctxs = devm_kcalloc(&pdev->dev, num_ctxs, sizeof(*ctxs), GFP_KERNEL); if (!ctxs) return -ENOMEM;