lkml.org 
[lkml]   [2010]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] DRM: Replace kmalloc/memset combos with kzalloc
From
Date
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),




\
 
 \ /
  Last update: 2010-08-11 16:37    [W:0.056 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site