Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-10 Thread Andrew Morton
On Thu, 10 Oct 2013 16:14:00 -0700 Joe Perches wrote: > On Thu, 2013-10-10 at 16:06 -0700, Andrew Morton wrote: > > On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches wrote: > > > > > I was a bit surprised to find there isn't a devm_kmalloc. > > > > Yes, the unconditional memset is silly. Especia

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-10 Thread Joe Perches
On Thu, 2013-10-10 at 19:18 -0400, Tejun Heo wrote: > Do we have an > actual cases where this makes meaningful differences? There are already a few array allocations where the array is completely reinitialized. Does it matter? Shrug. It's more API compatible and more symmetric. Direct conversi

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-10 Thread Tejun Heo
Hello, On Thu, Oct 10, 2013 at 04:06:03PM -0700, Andrew Morton wrote: > On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches 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 b

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-10 Thread Joe Perches
On Thu, 2013-10-10 at 16:06 -0700, Andrew Morton wrote: > On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches 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_

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-10 Thread Andrew Morton
On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches 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, n

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-08 Thread sangjung.woo
On 10/09/2013 01:59 PM, Joe Perches wrote: 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. I just sent the second patch file after modifying the commit message. Thank you for your opinion.

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-08 Thread Joe Perches
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(). > > [] > >> dif

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-08 Thread sangjung.woo
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

Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-08 Thread Joe Perches
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 am

[PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

2013-10-08 Thread Sangjung Woo
In order to be free automatically and make the cleanup paths more simple, use devm_kzalloc() instead of kzalloc(). Signed-off-by: Sangjung Woo --- drivers/rtc/rtc-pl030.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030