lkml.org 
[lkml]   [2013]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()
From
Date
On Wed, 2013-10-09 at 13:36 +0900, sangjung.woo wrote:
> On 10/09/2013 01:07 PM, Joe Perches wrote:
> > On Wed, 2013-10-09 at 13:00 +0900, Sangjung Woo wrote:
> >> In order to be free automatically and make the cleanup paths more
> >> simple, use devm_kzalloc() instead of kzalloc().
> > []
> >> diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
> > []
> >> @@ -106,7 +106,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id)
> >> if (ret)
> >> goto err_req;
> >>
> >> - rtc = kmalloc(sizeof(*rtc), GFP_KERNEL);
> >> + rtc = devm_kzalloc(&dev->dev, sizeof(*rtc), GFP_KERNEL);
[]
> > You're not deleting a memset and you're
> > converting a kmalloc.
> You are right.
> >
> > Why do you need the zalloc version?
> >
> The key point of this patch is resource-managed memory allocation.

The commit message doesn't match the patch subject
(shows kzalloc)

I was a bit surprised to find there isn't a devm_kmalloc.

This seems fine otherwise.



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