[RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

Josh Boyer jwboyer at linux.vnet.ibm.com
Mon Mar 24 22:45:31 EST 2008


On Mon, 24 Mar 2008 22:39:18 +1100
Paul Mackerras <paulus at samba.org> wrote:

> Josh Boyer writes:
> 
> > This adds a function called of_device_is_available that checks the state
> > of the status property of a device.  If the property is absent or set to
> > either "okay" or "ok", it returns 1.  Otherwise it returns 0.
> 
> Well actually...
> 
> > +	if (statlen > 0) {
> > +		if (!strncmp(status, "okay", 4) || !strncmp(status, "ok", 2))
> > +			return 1;
> 
> The second test will succeed for anything that starts with "ok", so
> the first test is redundant.  I suspect you want strcmp instead of
> strncmp in both tests.

GRR!  That's what I had in the original patch and you told me to use
strncmp instead.

If you want I can send out a v3.  Otherwise, perhaps you could just
munge the patch?

josh



More information about the Linuxppc-dev mailing list