From patchwork Wed Sep 21 16:53:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9343923 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 7C0DB607D4 for ; Wed, 21 Sep 2016 16:53:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FFCD2A802 for ; Wed, 21 Sep 2016 16:53:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 751E32A805; Wed, 21 Sep 2016 16:53:23 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 079412A802 for ; Wed, 21 Sep 2016 16:53:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54C886E878; Wed, 21 Sep 2016 16:53:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE3B26E878 for ; Wed, 21 Sep 2016 16:53:20 +0000 (UTC) Received: from [192.168.1.2] ([77.182.212.253]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LkyXt-1bEnWu2Qg1-00akOX; Wed, 21 Sep 2016 18:53:13 +0200 Subject: [PATCH 11/14] GPU-DRM-OMAP: Replace a kzalloc() call by kcalloc() in omap_gem_attach_pages() To: dri-devel@lists.freedesktop.org, David Airlie , Laurent Pinchart , Tomi Valkeinen References: <566ABCD9.1060404@users.sourceforge.net> <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Wed, 21 Sep 2016 18:53:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> X-Provags-ID: V03:K0:stRMUgLv1yu+WhoCagkqQI+tZyHdsqhKWsFNmAJGeOomfgVX7EI rIKO0BJ+5o7JxM/2b+UiR3gI7iCqCUp0IgpYuSilF1xhf4oUHLxdwxTlTJChdpiCNLpLIVv UT6oYOVYYENiHDv8v4t7Mx8pFyIMJNrPnGmD56hOG2MyTzClPo1keJwVn+uvn3d4uPpDRK8 n+xrFP7pHgh9+sIpbvMQw== X-UI-Out-Filterresults: notjunk:1; V01:K0:C7kmxeUn1gM=:A7CDpYEKxeahlZ3fW6/x1V 5t/q1p9DypLrevzHYg2xiA7N4o/3oOxvN3zVSM3F6YH9M70QEwqt/340wETqbKPw1EZZ305UU Yso+Q9kTDTgPRKJFVwK2IXI/nBlPo3FJ3M93LMlwxsXP6Y/CLAn1GLOQMdNwoQsMUQEqBKDHz 9wIMTEsoRpy3YJsB7p270OEYTFmlFpAdGdzFcWcR9lYr7KK0yjBhmeXjmAIyK6sMB45fIAHXD qtYhGprtzjbAGm5EEhcCCFkPEB6Yr+kn4NM2wyao7ge89bGWnabKD5C8PE0aDcy7PgQs74xeR 0jxaLogrxh9ZhsxLV6Y44eTmvucL+sMhi0mru957GHWe7CpOGT7iKS3YC0AB99dUMwSvJipg8 TccD56frjWbjmUSeKskKmeW0Bo5zrioPuGgKfCEogNuWpeucFgZz0TBejgQSbroZ4fK/rCIyB ud99frzekNPayXN+Wq3e8Kk9bJp1NlmClSMgzcRQ6q5nBQga/XQWmfby4lqylWUuuL2yZmvrr 3c4YPHK+9PQte14QZ4cg643AVU38gsNItWDNS5b8eu1VwCC6m323Wwhd8jEQ9jHwFQ97Ezgoh XnN05Ig43R9PJ8OJeTydXFjL2l9D5Xd53xulkY9NcdXDSplSCBAxeAUTCvwNuV6nix4U8E77n 0BRaRubE+DCYJYkJ6A1XIINMWQr89TEgGeHBjbpy5wzXks0FIJBLjcTOfsg6KQNOFW9vKQFWo xP21at1Hjtotz1iZlvqzWmBsT/UBvHrkNZhCzK/GaAqCUv7TButWuLqfjbgtS1bzHQylJ8fYv KZdMX86 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 21 Sep 2016 17:40:20 +0200 The script "checkpatch.pl" can point information out like the following. WARNING: Prefer kcalloc over kzalloc with multiply Thus fix the affected source code place. Signed-off-by: Markus Elfring --- drivers/gpu/drm/omapdrm/omap_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index e4f1924..26f1212 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -283,7 +283,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) } } } else { - addrs = kzalloc(npages * sizeof(*addrs), GFP_KERNEL); + addrs = kcalloc(npages, sizeof(*addrs), GFP_KERNEL); if (!addrs) { ret = -ENOMEM; goto free_pages;