From patchwork Mon Sep 19 15:56:49 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: 9339815 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 47AFA6077A for ; Mon, 19 Sep 2016 15:57:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38CF5294D5 for ; Mon, 19 Sep 2016 15:57:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DA3829523; Mon, 19 Sep 2016 15:57:04 +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 5B347294D5 for ; Mon, 19 Sep 2016 15:57:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BFB8A6E4D6; Mon, 19 Sep 2016 15:56:58 +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 BCAA76E4D6 for ; Mon, 19 Sep 2016 15:56:54 +0000 (UTC) Received: from [192.168.1.2] ([77.182.197.179]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MXYjm-1bRmuD0Fwk-00WXLt; Mon, 19 Sep 2016 17:56:51 +0200 Subject: [PATCH 4/5] GPU-DRM: Replace a kzalloc() call by kcalloc() in drm_legacy_addbufs_sg() To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie References: <566ABCD9.1060404@users.sourceforge.net> <2fd2da19-d57e-5017-0594-fd52e78493fa@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Mon, 19 Sep 2016 17:56:49 +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: <2fd2da19-d57e-5017-0594-fd52e78493fa@users.sourceforge.net> X-Provags-ID: V03:K0:rQSyAZZNjCXPAzxVUmCY+c+PmdsQDKRjvh+o9lIw3B6RgYLuOzl 3tpaZzbJSW54bipcfzeHJYdhol8yBWTv8oxQhWg3r0tXu1la07bjM8S8KDbvrwS93KLI/D6 zlQI2DSrGaSqHSQzrpSSy7ADDLi1hLxo2FA95TujhZMiMRdFRncCf7s8qwHMVbMKwfBXi2/ AluD9gsmsjcTCh99o2NDg== X-UI-Out-Filterresults: notjunk:1; V01:K0:pB6UK0sjYiA=:Lng6W7CIN3TrBgR4JCkNeX 8feCTRn1VKANzkzWWoA1MjdiXERc7ae+THmfCHJAUVQcWQi1gAOBtEn4nv7/mdkNfzwzaivWy XzJhDOykrg/xwx/DRTZrxbEj1wUZ9g8hKH8lOvrqrfuR3s4+mWghVO/tXbZMHKUnZYJytUziE 66qvqqMQWnehl6d7VVMnnrv79DRnGsNPR05fjtgM0m8B4xd1iQxLR3mHklHVLhV4drPJ3Y1yC tMcDHAsibnD7BNu8rSIq+8d2pKvAf5BdVyefqqTrIpqq/oMVKrAUUoe9DX0lwjBBma+gSrWmf 4omUTUvDXtx16jod3jDSy79kuF8REUXVu1Dng+rR7WnY2KzOZ2QN6862oZpG9z8KV7Y94XQTp zL/uAheUYnyCUnJOWMwU8/o4+HOgXnVZ70nx3knpdDEYr71eJU5QMJmTc86svdTnEFVV9JlKV fqFev3IPFgzgrltkO01IuW6wY5mVawdRA9lmrcP5wokCUkpuJSKbi0L7qfNAdiUAxE/3dwiug inCC88GKHyqpK0pXJsnd51VErJ0c/b7OHeHYE3ssLqQSqDpAu1n70cVdZD7H0o9RwMo18qiRP VG4rhlEyAGEC+fNWxIBsfdD/tQULONsipWR9e0BPiviwvRc3YLhe/qc5GeKydUpV97u3lc9YG L4crSYUQ8Luwe5QOMpHjfttSIV6fLE7gspMNS8/wxzURBXzKqeVOSu+cz2YcLuyG/EoXSZt73 Bo6anIhdTJBZnvsG8JE4juAK8krwvzeuV09Nmto922M1gIT6j/mTHI2BptfoDC7jYp27H4aLB Ijg7ky7 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: Mon, 19 Sep 2016 17:30:31 +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/drm_bufs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 36dd685..adb1dd7 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -1117,8 +1117,7 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev, return -EINVAL; } - entry->buflist = kzalloc(count * sizeof(*entry->buflist), - GFP_KERNEL); + entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL); if (!entry->buflist) { mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc);