Thread (8 messages) 8 messages, 5 authors, 2006-10-30

Re: Is get_property() correct?

From: Michael Ellerman <hidden>
Date: 2006-10-28 06:53:20

On Sat, 2006-10-28 at 00:41 -0600, Grant Likely wrote:
Is the implementation of get_property correct?  The comment says it
returns the value of a property; but the return statement just returns
the property pointer (cast as void*) it got from of_find_property();
not the value.
Minor correction, it returns the property->value pointer as a void *.
Does the comment or the code need to change?
I don't think so. get_property() can't return the actual value because
it doesn't know what type it is, so it returns a void pointer to the
value and it's up to the caller to interpret it based on the callers
knowledge of what it's expecting, and/or the lenp.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help