lkml.org 
[lkml]   [2013]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()
On Thu, 10 Oct 2013 16:14:00 -0700 Joe Perches <joe@perches.com> wrote:

> On Thu, 2013-10-10 at 16:06 -0700, Andrew Morton wrote:
> > On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches <joe@perches.com> wrote:
> >
> > > I was a bit surprised to find there isn't a devm_kmalloc.
> >
> > Yes, the unconditional memset is silly. Especially when the
> > function has a handy gfp_t and could be passed __GFP_ZERO.
> >
> > The comment says "managed kzalloc/kfree for device drivers, no kmalloc,
> > always use kzalloc". There's no explanation for this - it looks like
> > some ideological thing.
>
> Try this patch instead:
> https://lkml.org/lkml/2013/10/9/14
>

That looks rather better.

Apart from forcing a needless memset, the current code will defeat
kmemcheck used-uninitialized checking.


\
 
 \ /
  Last update: 2013-10-11 02:01    [W:0.075 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site