From: Antonio Quartulli <antonio@meshcoding.com>
To: Joe Perches <joe@perches.com>, Himangi Saraogi <himangi774@gmail.com>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
Simon Wunderlich <sw@simonwunderlich.de>,
"David S. Miller" <davem@davemloft.net>,
b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, julia.lawall@lip6.fr
Subject: Re: [PATCH] batman-adv: Use kasprintf
Date: Sat, 28 Jun 2014 21:49:22 +0200 [thread overview]
Message-ID: <53AF1C42.6000108@meshcoding.com> (raw)
In-Reply-To: <1403982781.9064.33.camel@joe-AO725>
[-- Attachment #1: Type: text/plain, Size: 993 bytes --]
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_type type,
> {
> int ret = -ENOMEM;
> struct kobject *bat_kobj;
> - char *uevent_env[4] = { NULL, NULL, NULL, NULL };
> + char *uevent_env[3];
Joe, why are you shortening this? kobject_uevent_env() expect a
NULL-terminating array (that is the forth cell).
...
>
> ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env);
And how is this change reducing the code space?
For what concerns the labels, we use this pattern mostly all over the
code: one single label/exit-point with the related NULL checks. Do you
think that we can improve something by changing this? (I am not talking
about the fastpath here).
Cheers,
--
Antonio Quartulli
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-06-28 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-28 18:36 [PATCH] batman-adv: Use kasprintf Himangi Saraogi
2014-06-28 19:13 ` Joe Perches
2014-06-28 19:49 ` Antonio Quartulli [this message]
2014-06-28 20:11 ` Joe Perches
2014-06-28 20:14 ` Julia Lawall
2014-07-08 0:00 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53AF1C42.6000108@meshcoding.com \
--to=antonio@meshcoding.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=himangi774@gmail.com \
--cc=joe@perches.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mareklindner@neomailbox.ch \
--cc=netdev@vger.kernel.org \
--cc=sw@simonwunderlich.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).