linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: linux-fbdev-devel@lists.sourceforge.net, adaplas@gmail.com,
	ak@suse.de, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [git patches] two warning fixes
Date: Mon, 23 Jul 2007 07:29:20 +1000	[thread overview]
Message-ID: <1185139760.5439.52.camel@localhost.localdomain> (raw)
In-Reply-To: <46A2D6F7.9080309@garzik.org>


> Not necessarily as simple as that -- you need to make sure you don't 
> pass something bogus to a sysfs_remove_blah() function at 
> unregister/unload time, if sysfs_create_blah() failed.
> 
> Certainly sysfs_foo() failure is often ignorable in the sense that you 
> want the driver to keep loading... but that does not imply that it is 
> strictly ignorable, if you also consider the associated cleanup code.

It should be trivial enough to have sysfs_create_blah() do enough
initializations before it can fail so that sysfs_remove_blah() do the
right thing regardless.

It's actually a major PITA for a driver that creates a whole bunch of
sysfs files to have to track precisely which ones were created
successfully for the error path. If it's a single function, goto does
the trick but if for some reason it's not, it's really annoying.

Ben.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

  reply	other threads:[~2007-07-22 21:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 23:55 [git patches] two warning fixes Jeff Garzik
2007-07-18 23:59 ` Andi Kleen
2007-07-19  0:05   ` Jeff Garzik
2007-07-19  1:19     ` Benjamin Herrenschmidt
2007-07-19  1:41       ` Andrew Morton
2007-07-19  1:50         ` Linus Torvalds
2007-07-19  2:05           ` Benjamin Herrenschmidt
2007-07-19  2:36           ` Andrew Morton
2007-07-19  1:37 ` Linus Torvalds
2007-07-19  2:32   ` Jeff Garzik
2007-07-19 13:40     ` Krzysztof Halasa
2007-07-19 18:04       ` Linus Torvalds
2007-07-19 18:20         ` Stephen Hemminger
2007-07-20 18:34         ` Krzysztof Halasa
2007-07-21  0:32           ` Benjamin Herrenschmidt
2007-07-22  4:03             ` Jeff Garzik
2007-07-22 21:29               ` Benjamin Herrenschmidt [this message]
2007-07-23  3:26         ` Kyle Moffett
2007-07-19 13:38   ` Krzysztof Halasa
2007-07-19 18:00     ` Linus Torvalds
2007-07-20 12:54       ` Tim Tassonis

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=1185139760.5439.52.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=adaplas@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=khc@pm.waw.pl \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).