lkml.org 
[lkml]   [2005]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kernel: use kcalloc instead kmalloc/memset
From
Date
On Fri, 2005-08-05 at 11:37 +0200, Roman Zippel wrote:
> Hi,
>
> On Thu, 4 Aug 2005, Andrew Morton wrote:
>
> > > +static inline void *kzalloc(size_t size, unsigned int __nocast flags)
> > > +{
> > > + return kcalloc(1, size, flags);
> > > +}
> > > +
> >
> > That'll generate just as much code as simply using kcalloc(1, ...). This
> > function should be out-of-line and EXPORT_SYMBOL()ed. And kcalloc() can
> > call it too..
>
> BTW we already have 420 "kcalloc(1, ...)" user and 41 without the 1
> argument, most of them are in sound, which introduced it in first place.
> Can we please deprecate that function before it spreads any further?

kcalloc does have value, in that it's a nice api to avoid multiplication
overflows. Just for "1" it's indeed not the most useful API.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-05 11:52    [from the cache]
©2003-2011 Jasper Spaans