All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Pekka J Enberg <penberg@cs.Helsinki.FI>
Cc: Jesper Juhl <jesper.juhl@gmail.com>,
	Ben Dooks <ben-linux@fluff.org>,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] release_resource() check for NULL resource
Date: Mon, 3 Oct 2005 14:42:47 +0100	[thread overview]
Message-ID: <20051003134247.GF16717@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.58.0510031610050.25136@sbz-30.cs.Helsinki.FI>

On Mon, Oct 03, 2005 at 04:12:41PM +0300, Pekka J Enberg wrote:
> On Mon, 3 Oct 2005, Russell King wrote:
> > However, I think you missed my point though.  release_resource() is
> > _not_ the counterpart of request_region().  It's the counter-part of
> > request_resource() which does not allocate any memory itself.
> 
> So what is the counter-part for request_region if it's not 
> release_resource? As far as I can tell, release_region is marked as 
> compatability cruft.

As I stated in previous mails, release_region() undoes all the effects
of request_region().  If you take a look at kernel/resource.c, you'll
notice that request_region() is also compatibility cruft as well.

> But anyway, my point is that dealing with NULL in many release functions 
> is beneficial for releasing a partially initialized state.

If that's what you think, thanks for volunteering to fix all the
sysfs and driver model interfaces as well.  The following examples
below functionally correspond to the request_resource()/
release_resource() and would also require fixing if what you think
were true.

request_resource	|	release_resource
------------------------+---------------------------
device_register		|	device_unregister
bus_register		|	bus_unregister
driver_register		|	driver_unregister

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2005-10-03 13:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-02 17:03 [PATCH] release_resource() check for NULL resource Ben Dooks
2005-10-02 17:39 ` Randy.Dunlap
2005-10-03  9:48   ` Ben Dooks
2005-10-03  9:59     ` Jesper Juhl
2005-10-03 10:04       ` Russell King
2005-10-03 12:43         ` Pekka Enberg
2005-10-03 12:49           ` Russell King
2005-10-03 12:54             ` Pekka J Enberg
2005-10-03 13:00               ` Russell King
2005-10-03 13:12                 ` Pekka J Enberg
2005-10-03 13:42                   ` Russell King [this message]
2005-10-03 13:42           ` Al Viro
2005-10-03 14:57             ` Pekka Enberg
2005-10-04  2:15         ` Randy.Dunlap
     [not found]   ` <5dc44ec70510031959w1f4adfcbh395535ade34a357d@mail.gmail.com>
2005-10-04  3:00     ` Diego de Estrada
2005-10-04  3:28     ` Randy.Dunlap
     [not found] <4TfvY-8ix-27@gated-at.bofh.it>
     [not found] ` <4Tg8u-Bn-15@gated-at.bofh.it>
     [not found]   ` <4Tv7u-5Hd-15@gated-at.bofh.it>
     [not found]     ` <4TvB0-6wD-3@gated-at.bofh.it>
     [not found]       ` <4TvB7-6wD-5@gated-at.bofh.it>
     [not found]         ` <4TxWv-1xD-37@gated-at.bofh.it>
2005-10-04 22:31           ` Bodo Eggert
2005-10-05  9:06             ` Russell King

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=20051003134247.GF16717@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=ben-linux@fluff.org \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.Helsinki.FI \
    --cc=rdunlap@xenotime.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.