From: Greg KH <greg@kroah.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] /lib/kobject.c
Date: Mon, 08 Mar 2010 21:35:29 +0000 [thread overview]
Message-ID: <20100308213529.GA21129@kroah.com> (raw)
In-Reply-To: <hn3pog$8co$1@dough.gmane.org>
On Mon, Mar 08, 2010 at 10:21:20PM +0100, Christophe Jaillet wrote:
> From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
>
> Hi, here is a patch against /lib/kobject.c.
>
> No need to allocate more memory than usefull.
> Here, we only need 12 (strlen("DEVPATH_OLD=")) + 1 (\0) extra bytes. This
> saves 2 bytes !!! and improve readability IMO.
Are you sure this really is even noticable anywhere? The memory is then
freed, right? So no real memory savings happen here.
>
>
> Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
>
> ---
>
> diff --git a/lib/kobject.c b/lib/kobject.c
> index 0487d1f..958cc76 100644
> --- a/lib/kobject.c
> +++ b/lib/kobject.c
> @@ -412,7 +412,7 @@ int kobject_rename(struct kobject *kobj, const char
> *new_name)
> error = -ENOMEM;
> goto out;
Your patch is line-wrapped and the tabs converted to spaces, making it
impossible to apply :(
> }
> - devpath_string = kmalloc(strlen(devpath) + 15, GFP_KERNEL);
> + devpath_string = kmalloc(12 + strlen(devpath) + 1, GFP_KERNEL);
> if (!devpath_string) {
> error = -ENOMEM;
> goto out;
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-03-08 21:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-08 21:21 [patch] /lib/kobject.c Christophe Jaillet
2010-03-08 21:35 ` Greg KH [this message]
2010-03-09 17:35 ` walter harms
2010-03-09 18:12 ` Greg KH
2010-03-09 18:49 ` Julia Lawall
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=20100308213529.GA21129@kroah.com \
--to=greg@kroah.com \
--cc=kernel-janitors@vger.kernel.org \
/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