From: Corey Minyard <minyard@acm.org>
To: Greg KH <greg@kroah.com>
Cc: Arjan van de Ven <arjan@infradead.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>,
Yani Ioannou <yani.ioannou@gmail.com>
Subject: Re: [PATCH 2/2] Add full sysfs support to the IPMI driver
Date: Wed, 22 Mar 2006 15:29:03 -0600 [thread overview]
Message-ID: <4421C19F.6040409@acm.org> (raw)
In-Reply-To: <20060322204751.GC12335@kroah.com>
Greg KH wrote:
>On Wed, Mar 22, 2006 at 10:01:09AM +0100, Arjan van de Ven wrote:
>
>
>>On Tue, 2006-03-21 at 16:13 -0600, Corey Minyard wrote:
>>
>>
>>
>>
>>>+static void ipmi_bmc_release(struct device *dev)
>>>+{
>>>+ printk(KERN_DEBUG "ipmi_bmc release\n");
>>>+}
>>>
>>>
>>eehhhh NO.
>>Please read the many comments and documentations about why a release
>>function is NOT allowed to be empty. In fact the kernel warned you about
>>that, didn't it?
>>
>>
>
>Of course that's not ok.
>
>Come on people, does everyone think I just put that warning message in
>the kernel for fun to force you to create an empty release function?
>Why do people ignore the helpful hints that the kernel provides?
>
>I can take that check out and watch people get their code wrong even
>more, as it sure doesn't seem like it is helping anyone out these
>days...
>
>Corey, haven't we discussed this in the past?
>
>
I don't think so, this is my first attempt at anything beyond a simple
class device for the driver model. This code was a rework of
something that came from someone else, so I never actually saw
the kernel message.
I did look in the include files while doing this and a little at the
driver-model docs, and I didn't see anything that jumped out and said
"THIS IS IMPORTANT". The release field documented in devices.txt,
for instance, says:
release: Callback to free the device after all references have
gone away. This should be set by the allocator of the
device (i.e. the bus driver that discovered the device).
It's not altogether obvious how to use this function or its importance
from this text, though if I had thought about it I would have figured
it out. If you want to affect behaviour, you need to add text
like: "NOTE: You must keep the data that holds the device structure
around until the release function is called. If you do not, something
could be using the device structure after you free it's data, resulting
in bad things happening". A comment should probably appear in
the include file, too.
If the issue Russell brought up is really an issue, it truely needs some
documentation written about it.
That said, I should have looked a little deeper on this. I saw it there,
read the docs and include file, and thought, "That's probably just there
to aid debugging," and left it in.
-Corey
prev parent reply other threads:[~2006-03-22 21:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-21 22:13 [PATCH 2/2] Add full sysfs support to the IPMI driver Corey Minyard
2006-03-22 9:01 ` Arjan van de Ven
2006-03-22 20:47 ` Greg KH
2006-03-22 20:59 ` Al Viro
2006-03-22 21:29 ` Corey Minyard [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=4421C19F.6040409@acm.org \
--to=minyard@acm.org \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yani.ioannou@gmail.com \
/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