From: Greg KH <greg@kroah.com>
To: Andrew Zabolotny <zap@homelink.ru>
Cc: Jeff Garzik <jgarzik@pobox.com>, linux-kernel@vger.kernel.org
Subject: Re: two patches - request for comments
Date: Wed, 2 Jun 2004 10:12:57 -0700 [thread overview]
Message-ID: <20040602171257.GK7829@kroah.com> (raw)
In-Reply-To: <20040602015740.3cedd197.zap@homelink.ru>
On Wed, Jun 02, 2004 at 01:57:40AM +0400, Andrew Zabolotny wrote:
> On Tue, 01 Jun 2004 17:23:11 -0400
> Jeff Garzik <jgarzik@pobox.com> wrote:
>
> > Typical Linux usage to an item being registered is
> > ptr = alloc_foo()
> > register_foo(ptr)
> > unregister_foo(ptr)
> > free_foo()
> In this case it is:
>
> register_lcd_device("foo", ...);
> ...
> unregister_lcd_device("foo");
>
> The name is guaranteed to be unique by sysfs design during the whole
> device lifetime, and calling unregister_xxx() outside the lifetime brackets
> is clearly an error.
>
> > It is quite unusual to unregister based on name. Pointers are far more
> > likely to be unique, and the programmer is far less likely to screw up
> > the unregister operation.
> I understand this, I see why it looks unusual. I'll fix this if it matters.
It matters, please fix it.
> It'll be something like:
>
> lcd_device = register_lcd_device ("foo", ...);
> ...
> unregister_lcd_device (lcd_device);
What about:
lcd_device = alloc_lcd_device("foo", ...);
error = register_lcd_device(lcd_device);
...
unregister_lcd_device(lcd_device);
thanks,
greg k-h
next prev parent reply other threads:[~2004-06-02 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-28 21:20 two patches - request for comments Andrew Zabolotny
2004-05-28 21:59 ` Todd Poynor
2004-05-29 8:10 ` Andrew Zabolotny
2004-06-01 20:09 ` Todd Poynor
2004-06-01 21:00 ` Andrew Zabolotny
2004-06-02 17:15 ` Greg KH
2004-06-02 21:25 ` Andrew Zabolotny
2004-06-02 21:32 ` Russell King
2004-06-04 20:43 ` Greg KH
2004-05-28 22:10 ` Greg KH
2004-05-29 8:44 ` Andrew Zabolotny
2004-06-01 21:23 ` Jeff Garzik
2004-06-01 21:57 ` Andrew Zabolotny
2004-06-02 17:12 ` Greg KH [this message]
2004-05-29 13:46 ` Denis Vlasenko
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=20040602171257.GK7829@kroah.com \
--to=greg@kroah.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zap@homelink.ru \
/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