From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] OF: base: add empty property value pointer
Date: Sun, 23 Jun 2013 22:29:23 +0200 [thread overview]
Message-ID: <51C75AA3.8080202@gmail.com> (raw)
In-Reply-To: <20130623202619.GS32299@pengutronix.de>
On 06/23/2013 10:26 PM, Sascha Hauer wrote:
> On Sun, Jun 23, 2013 at 10:11:39PM +0200, Sebastian Hesselbarth wrote:
>> On 06/23/2013 08:33 PM, Sascha Hauer wrote:
>>> Why do we need this anyway? We can always call of_find_property() to see
>>> if a property exists.
>>
>> Actually, I was preparing to import drivers/of/address.c from linux.
>> of_translate_one uses of_get_property on "ranges". This returns
>> the property's value pointer instead of the property itself, which
>> is NULL for an empty ranges property. Now that you point it out,
>> using of_find_property is also an option.
>>
>> Nevertheless, patches 1 (with your comments applied) and 2 seem
>> sensible to me. Patch 3 is an option to keep it in sync with Linux
>> OF API behavior but is optional.
>
> How about allocating zero length property values with malloc(0)? This
> makes them less special.
Agree, I will update the patch set and send a v2 hopefully soon.
Sebastian
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-06-23 20:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-21 15:15 [PATCH 0/3] OF: base: cleanup and allow empty properties Sebastian Hesselbarth
2013-06-21 15:15 ` [PATCH 1/3] OF: base: add sanity checks to of_new/delete_property Sebastian Hesselbarth
2013-06-23 18:24 ` Sascha Hauer
2013-06-21 15:15 ` [PATCH 2/3] OF: base: use of_delete_property where applicable Sebastian Hesselbarth
2013-06-21 15:15 ` [PATCH 3/3] OF: base: add empty property value pointer Sebastian Hesselbarth
2013-06-23 18:33 ` Sascha Hauer
2013-06-23 20:11 ` Sebastian Hesselbarth
2013-06-23 20:26 ` Sascha Hauer
2013-06-23 20:29 ` Sebastian Hesselbarth [this message]
2013-06-24 10:49 ` [PATCH v2 1/2] OF: base: add sanity checks to of_new/delete_property Sebastian Hesselbarth
2013-06-24 19:40 ` Sascha Hauer
2013-06-24 10:49 ` [PATCH v2 2/2] OF: base: use of_delete_property where applicable Sebastian Hesselbarth
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=51C75AA3.8080202@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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