[PATCH][OF] Add of_device_is_available function

Josh Boyer jwboyer at linux.vnet.ibm.com
Wed Feb 27 10:53:26 EST 2008


On Tue, 26 Feb 2008 14:44:23 -0800 (PST)
David Miller <davem at davemloft.net> wrote:

> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Date: Wed, 27 Feb 2008 08:45:37 +1100
> 
> > I doubt we do that. Properties that contain things like ranges, or "reg"
> > properties are expected to be of a size that is a multiple of
> > #size-cells/#address-cells and I'm not sure that won't break things here
> > or there if they suddenly get one more byte..
> > 
> > Or do you mean you/we are appending that-without- changing the length
> > field ?
> 
> Right, simply don't change the length field.  Put the zero byte
> at offset "length + 1"
> 
> It's stupid to validate NULL termination everywhere when we
> can make it an invariant in one spot.

I don't mind fixing up the function to use strncmp and checking for a 0
length from of_get_property.  However, I'm almost certain that other
places in the code have the same issue so what you're saying here seems
to make sense.

josh



More information about the Linuxppc-dev mailing list