On Tuesday, November 04, 2014 04:32:54 PM Timur Tabi wrote:
> On 11/04/2014 04:47 PM, Rafael J. Wysocki wrote:
> > What exactly do you need the size of the property alone for?
> 
> There are lots of situations where you don't know the size of the 
> property in advance (e.g. strings), and drivers use of_find_property() 
> or of_get_property() to pre-allocate a buffer or to verify that the 
> property is correctly formed in the device tree.

The problem is that in ACPI properties are not contiguous buffers full
of data.  They generally have internal structure.

But device_property_read_string(), for example, gives you a pointer to
the value of the property and you can check the size of that just fine
using strlen().  Isn't that sufficient?

Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to