From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: Is get_property() correct?
Date: Sat, 28 Oct 2006 17:23:55 +1000 [thread overview]
Message-ID: <1162020235.25682.124.camel@localhost.localdomain> (raw)
In-Reply-To: <528646bc0610272341s3c655ebbn785b373f148f6174@mail.gmail.com>
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.
>
> Does the comment or the code need to change?
Well considering that we don't know the type of the property value, the
best we can do is return a pointer to it ...
The comment might want an update, though it never stroke me as confusing
but heh :)
> in prom.c:
>
> /*
> * Find a property with a given name for a given node
> * and return the value.
> */
> const void *get_property(const struct device_node *np, const char *name,
> int *lenp)
> {
> struct property *pp = of_find_property(np,name,lenp);
> return pp ? pp->value : NULL;
> }
> EXPORT_SYMBOL(get_property);
>
> Cheers,
> g.
>
next prev parent reply other threads:[~2006-10-28 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-28 6:41 Is get_property() correct? Grant Likely
2006-10-28 6:53 ` Michael Ellerman
2006-10-28 7:17 ` Johannes Berg
2006-10-28 7:23 ` Grant Likely
2006-10-28 7:23 ` Benjamin Herrenschmidt [this message]
2006-10-28 7:38 ` Grant Likely
2006-10-28 9:08 ` Michael Ellerman
2006-10-30 2:05 ` unsubscribe Usha Rani Konudula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1162020235.25682.124.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).