public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@gnu.org>
To: Joe Perches <joe@perches.com>
Cc: Dave Airlie <airlied@redhat.com>, Dave Airlie <airlied@linux.ie>,
	eric@anholt.net, dri-devel <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] DRM: Replace kmalloc/memset combos with kzalloc
Date: Wed, 11 Aug 2010 15:58:43 -0400	[thread overview]
Message-ID: <1281556723.1861.3.camel@cowboy> (raw)
In-Reply-To: <1281537344.3976.32.camel@Joe-Laptop.home>

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


  reply	other threads:[~2010-08-11 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11 13:18 [PATCH] DRM: Replace kmalloc/memset combos with kzalloc Davidlohr Bueso
2010-08-11 14:35 ` Joe Perches
2010-08-11 19:58   ` Davidlohr Bueso [this message]
2010-08-12  3:12     ` Kristian Høgsberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281556723.1861.3.camel@cowboy \
    --to=dave@gnu.org \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox