LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ben Dooks <ben@trinity.fluff.org>
Cc: rpurdie@rpsys.net, ben-linux@fluff.org, linux-kernel@vger.kernel.org
Subject: Re: LEDS: S3C24XX generate name if none given
Date: Mon, 22 Jan 2007 11:56:24 -0800 [thread overview]
Message-ID: <20070122115624.2aefb97c.akpm@osdl.org> (raw)
In-Reply-To: <20070115154221.GH11889@trinity.fluff.org>
> On Mon, 15 Jan 2007 15:42:21 +0000 Ben Dooks <ben@trinity.fluff.org> wrote:
> On Mon, Jan 15, 2007 at 01:44:28PM +0000, Richard Purdie wrote:
> > On Mon, 2007-01-15 at 12:26 +0000, Ben Dooks wrote:
> > > Generate a name if none is passed to the S3C24XX GPIO LED driver.
Wouldn't it be better to fix the callers to consistently pass in a name
rather than hacking around fixing stuff up in the callee?
> + /* create name if we were not passed one */
> +
> + if (led->cdev.name == NULL) {
> + char name[64];
> +
> + snprintf(name, sizeof(name), "%s.%d", dev->name, dev->id);
> + led->cdev.name = kstrdup(name);
> + }
> +
Take a peek at kasprintf() ;)
Please include full-and-fresh changelog in each iteration of a patch, so
poor patch-takers don't have to go making one up for you, thanks.
prev parent reply other threads:[~2007-01-22 19:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-15 12:26 Ben Dooks
2007-01-15 12:32 ` Robert P. J. Day
2007-01-15 13:44 ` Richard Purdie
2007-01-15 15:42 ` Ben Dooks
2007-01-16 19:06 ` Richard Purdie
2007-01-22 19:56 ` Andrew Morton [this message]
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=20070122115624.2aefb97c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ben-linux@fluff.org \
--cc=ben@trinity.fluff.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--subject='Re: LEDS: S3C24XX generate name if none given' \
/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
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).