* [U-Boot] [PATCH v2 0/3] libfdt: fix bugs
@ 2015-07-14 16:08 Masahiro Yamada
2015-07-14 16:08 ` [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string() Masahiro Yamada
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Masahiro Yamada @ 2015-07-14 16:08 UTC (permalink / raw)
To: u-boot
This series fixes bugs of libfdt.
These functions were added by Thierry for U-boot only.
So, we do not send it back to the DTC ML.
Masahiro Yamada (3):
libfdt: fix description of fdt_get_string()
libfdt: fix error code of fdt_get_string_index()
libfdt: fix error code of fdt_count_strings()
include/libfdt.h | 2 +-
lib/libfdt/fdt_ro.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string()
2015-07-14 16:08 [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Masahiro Yamada
@ 2015-07-14 16:08 ` Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-14 16:08 ` [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index() Masahiro Yamada
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Masahiro Yamada @ 2015-07-14 16:08 UTC (permalink / raw)
To: u-boot
Looks like this comment was copied from that of
fdt_get_string_index().
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
---
Changes in v2: None
include/libfdt.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/libfdt.h b/include/libfdt.h
index f3cbb63..421d64f 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -915,7 +915,7 @@ int fdt_get_string_index(const void *fdt, int node, const char *property,
int index, const char **output);
/**
- * fdt_get_string() - obtain the string at a given index in a string list
+ * fdt_get_string() - obtain the first string in a string list
* @fdt: pointer to the device tree blob
* @node: offset of the node
* @property: name of the property containing the string list
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index()
2015-07-14 16:08 [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Masahiro Yamada
2015-07-14 16:08 ` [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string() Masahiro Yamada
@ 2015-07-14 16:08 ` Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-14 16:08 ` [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings() Masahiro Yamada
2015-07-14 18:16 ` [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Scott Wood
3 siblings, 1 reply; 14+ messages in thread
From: Masahiro Yamada @ 2015-07-14 16:08 UTC (permalink / raw)
To: u-boot
As mentioned in the comment block in include/libfdt.h,
fdt_get_string_index() is supposed to return a negative value
on error.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
---
Changes in v2:
- minor fix in git-log (drop "commit")
- return code -> error code
lib/libfdt/fdt_ro.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 44fc0aa..38bfcbd 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -577,7 +577,7 @@ int fdt_get_string_index(const void *fdt, int node, const char *property,
index--;
}
- return FDT_ERR_NOTFOUND;
+ return -FDT_ERR_NOTFOUND;
}
int fdt_get_string(const void *fdt, int node, const char *property,
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings()
2015-07-14 16:08 [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Masahiro Yamada
2015-07-14 16:08 ` [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string() Masahiro Yamada
2015-07-14 16:08 ` [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index() Masahiro Yamada
@ 2015-07-14 16:08 ` Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-14 18:16 ` [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Scott Wood
3 siblings, 1 reply; 14+ messages in thread
From: Masahiro Yamada @ 2015-07-14 16:08 UTC (permalink / raw)
To: u-boot
Currently, this function returns a positive value on error,
so we never know whether this function has succeeded or failed.
For example, if the given property is not found, fdt_getprop()
returns -FDT_ERR_NOTFOUND, and then this function inverts it,
i.e., returns FDT_ERR_NOTFOUND (=1).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: bc4147ab2d69 ("fdt: Add a function to count strings")
---
Changes in v2: None
lib/libfdt/fdt_ro.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 38bfcbd..7b0777b 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -517,7 +517,7 @@ int fdt_count_strings(const void *fdt, int node, const char *property)
list = fdt_getprop(fdt, node, property, &length);
if (!list)
- return -length;
+ return length;
for (i = 0; i < length; i++) {
int len = strlen(list);
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 0/3] libfdt: fix bugs
2015-07-14 16:08 [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Masahiro Yamada
` (2 preceding siblings ...)
2015-07-14 16:08 ` [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings() Masahiro Yamada
@ 2015-07-14 18:16 ` Scott Wood
2015-07-18 14:36 ` Simon Glass
3 siblings, 1 reply; 14+ messages in thread
From: Scott Wood @ 2015-07-14 18:16 UTC (permalink / raw)
To: u-boot
On Wed, 2015-07-15 at 01:08 +0900, Masahiro Yamada wrote:
> This series fixes bugs of libfdt.
>
> These functions were added by Thierry for U-boot only.
> So, we do not send it back to the DTC ML.
If they're not part of upstream dtc, why are they in the libfdt directory?
Have they been sent upstream but not merged?
-Scott
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string()
2015-07-14 16:08 ` [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string() Masahiro Yamada
@ 2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
0 siblings, 1 reply; 14+ messages in thread
From: Simon Glass @ 2015-07-18 14:36 UTC (permalink / raw)
To: u-boot
On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Looks like this comment was copied from that of
> fdt_get_string_index().
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
> ---
>
> Changes in v2: None
>
> include/libfdt.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index()
2015-07-14 16:08 ` [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index() Masahiro Yamada
@ 2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
0 siblings, 1 reply; 14+ messages in thread
From: Simon Glass @ 2015-07-18 14:36 UTC (permalink / raw)
To: u-boot
On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> As mentioned in the comment block in include/libfdt.h,
> fdt_get_string_index() is supposed to return a negative value
> on error.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
> ---
>
> Changes in v2:
> - minor fix in git-log (drop "commit")
> - return code -> error code
>
> lib/libfdt/fdt_ro.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings()
2015-07-14 16:08 ` [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings() Masahiro Yamada
@ 2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
0 siblings, 1 reply; 14+ messages in thread
From: Simon Glass @ 2015-07-18 14:36 UTC (permalink / raw)
To: u-boot
On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Currently, this function returns a positive value on error,
> so we never know whether this function has succeeded or failed.
>
> For example, if the given property is not found, fdt_getprop()
> returns -FDT_ERR_NOTFOUND, and then this function inverts it,
> i.e., returns FDT_ERR_NOTFOUND (=1).
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: bc4147ab2d69 ("fdt: Add a function to count strings")
> ---
>
> Changes in v2: None
>
> lib/libfdt/fdt_ro.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
> index 38bfcbd..7b0777b 100644
> --- a/lib/libfdt/fdt_ro.c
> +++ b/lib/libfdt/fdt_ro.c
> @@ -517,7 +517,7 @@ int fdt_count_strings(const void *fdt, int node, const char *property)
>
> list = fdt_getprop(fdt, node, property, &length);
> if (!list)
> - return -length;
> + return length;
>
> for (i = 0; i < length; i++) {
> int len = strlen(list);
> --
> 1.9.1
>
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 0/3] libfdt: fix bugs
2015-07-14 18:16 ` [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Scott Wood
@ 2015-07-18 14:36 ` Simon Glass
2015-07-18 17:42 ` Scott Wood
0 siblings, 1 reply; 14+ messages in thread
From: Simon Glass @ 2015-07-18 14:36 UTC (permalink / raw)
To: u-boot
Hi Scott,
On 14 July 2015 at 12:16, Scott Wood <scottwood@freescale.com> wrote:
> On Wed, 2015-07-15 at 01:08 +0900, Masahiro Yamada wrote:
>> This series fixes bugs of libfdt.
>>
>> These functions were added by Thierry for U-boot only.
>> So, we do not send it back to the DTC ML.
>
> If they're not part of upstream dtc, why are they in the libfdt directory?
> Have they been sent upstream but not merged?
>
> -Scott
To avoid roadblocks we take patches in libfdt before they are merged
upstream. I then tidy things up when I see them applied. So sometimes
we are a little ahead of libfdt for a while. It works out OK since we
need to sync with upstream regularly anyway.
Regards,
Simon
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 0/3] libfdt: fix bugs
2015-07-18 14:36 ` Simon Glass
@ 2015-07-18 17:42 ` Scott Wood
2015-07-20 2:10 ` Simon Glass
0 siblings, 1 reply; 14+ messages in thread
From: Scott Wood @ 2015-07-18 17:42 UTC (permalink / raw)
To: u-boot
On Sat, 2015-07-18 at 08:36 -0600, Simon Glass wrote:
> Hi Scott,
>
> On 14 July 2015 at 12:16, Scott Wood <scottwood@freescale.com> wrote:
> > On Wed, 2015-07-15 at 01:08 +0900, Masahiro Yamada wrote:
> > > This series fixes bugs of libfdt.
> > >
> > > These functions were added by Thierry for U-boot only.
> > > So, we do not send it back to the DTC ML.
> >
> > If they're not part of upstream dtc, why are they in the libfdt directory?
> > Have they been sent upstream but not merged?
> >
> > -Scott
>
> To avoid roadblocks we take patches in libfdt before they are merged
> upstream. I then tidy things up when I see them applied. So sometimes
> we are a little ahead of libfdt for a while. It works out OK since we
> need to sync with upstream regularly anyway.
That's fine, but from what Masahiro said, it sounded like there was no intent
to ever push these to upstream dtc.
-Scott
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 0/3] libfdt: fix bugs
2015-07-18 17:42 ` Scott Wood
@ 2015-07-20 2:10 ` Simon Glass
0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2015-07-20 2:10 UTC (permalink / raw)
To: u-boot
+Thierry
Hi Scott,
On 18 July 2015 at 11:42, Scott Wood <scottwood@freescale.com> wrote:
> On Sat, 2015-07-18 at 08:36 -0600, Simon Glass wrote:
>> Hi Scott,
>>
>> On 14 July 2015 at 12:16, Scott Wood <scottwood@freescale.com> wrote:
>> > On Wed, 2015-07-15 at 01:08 +0900, Masahiro Yamada wrote:
>> > > This series fixes bugs of libfdt.
>> > >
>> > > These functions were added by Thierry for U-boot only.
>> > > So, we do not send it back to the DTC ML.
>> >
>> > If they're not part of upstream dtc, why are they in the libfdt directory?
>> > Have they been sent upstream but not merged?
>> >
>> > -Scott
>>
>> To avoid roadblocks we take patches in libfdt before they are merged
>> upstream. I then tidy things up when I see them applied. So sometimes
>> we are a little ahead of libfdt for a while. It works out OK since we
>> need to sync with upstream regularly anyway.
>
> That's fine, but from what Masahiro said, it sounded like there was no intent
> to ever push these to upstream dtc.
I think it as just forgotten. Thierry sent it a few days ago and it
looks promising so far.
Regards,
Simon
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string()
2015-07-18 14:36 ` Simon Glass
@ 2015-07-20 13:25 ` Simon Glass
0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2015-07-20 13:25 UTC (permalink / raw)
To: u-boot
On 18 July 2015 at 08:36, Simon Glass <sjg@chromium.org> wrote:
> On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> Looks like this comment was copied from that of
>> fdt_get_string_index().
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
>> ---
>>
>> Changes in v2: None
>>
>> include/libfdt.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-fdt, thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index()
2015-07-18 14:36 ` Simon Glass
@ 2015-07-20 13:25 ` Simon Glass
0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2015-07-20 13:25 UTC (permalink / raw)
To: u-boot
On 18 July 2015 at 08:36, Simon Glass <sjg@chromium.org> wrote:
> On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> As mentioned in the comment block in include/libfdt.h,
>> fdt_get_string_index() is supposed to return a negative value
>> on error.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
>> ---
>>
>> Changes in v2:
>> - minor fix in git-log (drop "commit")
>> - return code -> error code
>>
>> lib/libfdt/fdt_ro.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-fdt, thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings()
2015-07-18 14:36 ` Simon Glass
@ 2015-07-20 13:25 ` Simon Glass
0 siblings, 0 replies; 14+ messages in thread
From: Simon Glass @ 2015-07-20 13:25 UTC (permalink / raw)
To: u-boot
On 18 July 2015 at 08:36, Simon Glass <sjg@chromium.org> wrote:
> On 14 July 2015 at 10:08, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> Currently, this function returns a positive value on error,
>> so we never know whether this function has succeeded or failed.
>>
>> For example, if the given property is not found, fdt_getprop()
>> returns -FDT_ERR_NOTFOUND, and then this function inverts it,
>> i.e., returns FDT_ERR_NOTFOUND (=1).
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Fixes: bc4147ab2d69 ("fdt: Add a function to count strings")
>> ---
>>
>> Changes in v2: None
>>
>> lib/libfdt/fdt_ro.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
>> index 38bfcbd..7b0777b 100644
>> --- a/lib/libfdt/fdt_ro.c
>> +++ b/lib/libfdt/fdt_ro.c
>> @@ -517,7 +517,7 @@ int fdt_count_strings(const void *fdt, int node, const char *property)
>>
>> list = fdt_getprop(fdt, node, property, &length);
>> if (!list)
>> - return -length;
>> + return length;
>>
>> for (i = 0; i < length; i++) {
>> int len = strlen(list);
>> --
>> 1.9.1
>>
>
> Acked-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-fdt, thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-07-20 13:25 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 16:08 [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Masahiro Yamada
2015-07-14 16:08 ` [U-Boot] [PATCH v2 1/3] libfdt: fix description of fdt_get_string() Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
2015-07-14 16:08 ` [U-Boot] [PATCH v2 2/3] libfdt: fix error code of fdt_get_string_index() Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
2015-07-14 16:08 ` [U-Boot] [PATCH v2 3/3] libfdt: fix error code of fdt_count_strings() Masahiro Yamada
2015-07-18 14:36 ` Simon Glass
2015-07-20 13:25 ` Simon Glass
2015-07-14 18:16 ` [U-Boot] [PATCH v2 0/3] libfdt: fix bugs Scott Wood
2015-07-18 14:36 ` Simon Glass
2015-07-18 17:42 ` Scott Wood
2015-07-20 2:10 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.