lkml.org 
[lkml]   [2013]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] device: Add kernel standard devm_k.alloc functions
On Tue, Oct 08, 2013 at 10:32:27PM -0700, Joe Perches wrote:
> Currently, devm_ managed memory only supports kzalloc.
>
> Convert the devm_kzalloc implementation to devm_kmalloc
> and remove the complete memset to 0 but still set the
> initial struct devres header and whatever padding before
> data to 0.
>
> Add the other normal alloc variants as static inlines with
> __GFP_ZERO added to the gfp flag where appropriate:
>
> devm_kzalloc
> devm_kcalloc
> devm_kmalloc_array
>
> Add gfp.h to device.h for the newly added static inlines.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/base/devres.c | 27 ++++++++++++++++-----------
> include/linux/device.h | 21 +++++++++++++++++++--
> 2 files changed, 35 insertions(+), 13 deletions(-)

Makes sense to me, does this let other drivers start to use this where
they were not able to in the past?

thanks,

greg k-h


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