From: Davidlohr Bueso Subject: Re: [PATCH] DRM: Replace kmalloc/memset combos with kzalloc Date: Wed, 11 Aug 2010 15:58:43 -0400 Message-ID: <1281556723.1861.3.camel@cowboy> References: <1281532732.2067.11.camel@cowboy> <1281537344.3976.32.camel@Joe-Laptop.home> Reply-To: dave@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1281537344.3976.32.camel@Joe-Laptop.home> Sender: linux-kernel-owner@vger.kernel.org To: Joe Perches Cc: Dave Airlie , Dave Airlie , eric@anholt.net, dri-devel , LKML List-Id: dri-devel@lists.freedesktop.org On Wed, 2010-08-11 at 07:35 -0700, Joe Perches wrote: > On Wed, 2010-08-11 at 09:18 -0400, Davidlohr Bueso wrote: > > memory allocation in drm_bufs.c is followed by initializing the memory with 0. > > > > Replace the use of kmalloc+memset with kzalloc. > > Perhaps kzalloc's with a multiply could/should also be converted > to kcalloc. > > > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), GFP_KERNEL); > > entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL); > > etc. > > > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), GFP_KERNEL); > > + entry->seglist = kzalloc(count * sizeof(*entry->seglist), GFP_KERNEL); > > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), > > + entry->buflist = kzalloc(count * sizeof(*entry->buflist), > Doable, but don't see much difference. David, what do you think? Thanks, Davidlohr