Subject: Re: [RFC/PATCH 4/4] Add support for MSI on Axon-based Cell systems

From: Arnd Bergmann <[email-masked]>
Date: Fri, 8 Jun 2007 22:06:55 +0200

On Friday 08 June 2007, Segher Boessenkool wrote:
> > That wasn't my question though?
>=20
> Oh wait. =A0You're saying for_each_compatible_node() does
> a put() on all nodes it traverses, but no get()? =A0Ouch!

No, just read the code, it does exactly the right thing.

If you do

for_each_compatible_node(node, NULL, "foo") {
	do_something(node);
}

then the reference count is held just as long as the do_something()
function is run, and if you do

for_each_compatible_node(node, NULL, "foo")
	if (conditional_func(node))
		break;

then the node variable will have the reference count.

	Arnd <><