[PATCH 06/18] Make ft_node_add() accept and return NULL.

Scott Wood scottwood at freescale.com
Thu Jan 25 09:02:54 EST 2007


Segher Boessenkool wrote:
>> Currently, if ft_node_add() is passed NULL it will allocate an  entry for
>> it and return a non-NULL phandle.  This patch makes it simply pass the
>> NULL through.
> 
> 
> Hrm, is this a good thing?  Shouldn't you just BUG_ON()
> instead?

There are times where NULL is normal -- such as at the end of an 
iteration to find every instance of a certain type of node, or to follow 
parentage to the root node.  Having ft_node_add() pass the NULL through 
keeps it from being a special case in all of the wrapper code that turns 
the internal node into a phandle before returning.

-Scott



More information about the Linuxppc-dev mailing list