Re: [PATCH] batman-adv: Use kasprintf

2014-07-07 Thread David Miller
From: Himangi Saraogi Date: Sun, 29 Jun 2014 00:06:29 +0530 > kasprintf combines kmalloc and sprintf, and takes care of the size > calculation itself. > > The semantic patch that makes this change is as follows: ... > Signed-off-by: Himangi Saraogi > Acked-by: Julia Lawall Applied, thanks. -

Re: [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Julia Lawall
On Sat, 28 Jun 2014, Antonio Quartulli wrote: > Hi all, > > On 28/06/14 21:13, Joe Perches wrote: > > diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c > > index f40cb04..d6fba94 100644 > > --- a/net/batman-adv/sysfs.c > > +++ b/net/batman-adv/sysfs.c > > @@ -896,7 +896,7 @@ int batadv

Re: [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Joe Perches
On Sat, 2014-06-28 at 21:49 +0200, Antonio Quartulli wrote: > Hi all, > > On 28/06/14 21:13, Joe Perches wrote: > > diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c [] > > @@ -896,7 +896,7 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, > > enum batadv_uev_type type, > > { >

Re: [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Antonio Quartulli
Hi all, On 28/06/14 21:13, Joe Perches wrote: > diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c > index f40cb04..d6fba94 100644 > --- a/net/batman-adv/sysfs.c > +++ b/net/batman-adv/sysfs.c > @@ -896,7 +896,7 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, > enum batadv_uev_

Re: [PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Joe Perches
On Sun, 2014-06-29 at 00:06 +0530, Himangi Saraogi wrote: > kasprintf combines kmalloc and sprintf, and takes care of the size > calculation itself. Nice. A small conversion to remove unnecessary initializations, avoid calling kfree with known NULL pointers, and save a few bytes of code space wou

[PATCH] batman-adv: Use kasprintf

2014-06-28 Thread Himangi Saraogi
kasprintf combines kmalloc and sprintf, and takes care of the size calculation itself. The semantic patch that makes this change is as follows: // @@ expression a,flag; expression list args; statement S; @@ a = - \(kmalloc\|kzalloc\)(...,flag) + kasprintf(flag,args) <... when != a if (a