libfdt: fix bugs
v2 cover libfdt: fix bugs
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(-)
Signature · 1 line
1.9.1
PATCH v2 1/3 libfdt: fix description of fdt_get_string()
Looks like this comment was copied from that offdt_get_string_index().
---
Changes in v2: None
include/libfdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/libfdt.h +1 -1
@@ -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
Signature · 1 line
1.9.1
PATCH v2 1/3 libfdt: fix description of fdt_get_string()
Quoted 11 lines · Masahiro Yamada
Looks like this comment was copied from that of
fdt_get_string_index().Signed-off-by Masahiro Yamada <[email protected]>Fixes 5094eb408a5d ("fdt: Add functions to retrieve strings")---
Changes in v2: None
include/libfdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 1/3 libfdt: fix description of fdt_get_string()
Quoted 8 lines · Simon Glass
Quoted 7 lines · Masahiro Yamada
Looks like this comment was copied from that of
fdt_get_string_index().Signed-off-by Masahiro Yamada <[email protected]>Fixes 5094eb408a5d ("fdt: Add functions to retrieve strings")---
Quoted 6 lines
Quoted 4 lines
Changes in v2: None
include/libfdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Acked-by Simon Glass <[email protected]>
Applied to u-boot-fdt, thanks!
PATCH v2 2/3 libfdt: fix error code of fdt_get_string_index()
In reply to Masahiro YamadaAs mentioned in the comment block in include/libfdt.h, fdt_get_string_index() is supposed to return a negative value on error.
---
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(-)
lib/libfdt/fdt_ro.c +1 -1
@@ -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,
Signature · 1 line
1.9.1
PATCH v2 2/3 libfdt: fix error code of fdt_get_string_index()
Quoted 6 lines · Masahiro Yamada
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 <[email protected]>Fixes 5094eb408a5d ("fdt: Add functions to retrieve strings")
Quoted 8 lines
---
Changes in v2:
- minor fix in git-log (drop "commit")
- return code -> error codelib/libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 2/3 libfdt: fix error code of fdt_get_string_index()
Quoted 9 lines · Simon Glass
Quoted 8 lines · Masahiro Yamada
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 <[email protected]>Fixes 5094eb408a5d ("fdt: Add functions to retrieve strings")---
Quoted 8 lines
Quoted 6 lines
Changes in v2:
- minor fix in git-log (drop "commit")
- return code -> error codelib/libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Acked-by Simon Glass <[email protected]>
Applied to u-boot-fdt, thanks!
PATCH v2 3/3 libfdt: fix error code of fdt_count_strings()
In reply to Masahiro YamadaCurrently, 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).
---
Changes in v2: None
lib/libfdt/fdt_ro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/libfdt/fdt_ro.c +1 -1
@@ -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);
Signature · 1 line
1.9.1
PATCH v2 3/3 libfdt: fix error code of fdt_count_strings()
Quoted 30 lines · Masahiro Yamada
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., returnsFDT_ERR_NOTFOUND(=1).Signed-off-by Masahiro Yamada <[email protected]>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(-)lib/libfdt/fdt_ro.c +1
-2@@ -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); --
Quoted 2 lines
1.9.1
PATCH v2 3/3 libfdt: fix error code of fdt_count_strings()
Quoted 28 lines · Simon Glass
Quoted 27 lines · Masahiro Yamada
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., returnsFDT_ERR_NOTFOUND(=1).Signed-off-by Masahiro Yamada <[email protected]>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(-)lib/libfdt/fdt_ro.c +1
-1@@ -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;
Quoted 7 lines
Quoted 5 lines
lib/libfdt/fdt_ro.c +0
-1for (i =0 ; i < length; i++) {int len =strlen (list); --1.9.1
Acked-by Simon Glass <[email protected]>
Applied to u-boot-fdt, thanks!
v2 cover libfdt: fix bugs
In reply to Masahiro YamadaQuoted 4 lines · Masahiro Yamada
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
v2 cover libfdt: fix bugs
Hi Scott,
Quoted 10 lines · Scott Wood
Quoted 4 lines · Masahiro Yamada
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
v2 cover libfdt: fix bugs
Quoted 12 lines · Simon Glass
Hi Scott,
Quoted 9 lines · Scott Wood
Quoted 4 lines · Masahiro Yamada
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?
Quoted 6 lines
Quoted 1 line
-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
v2 cover libfdt: fix bugs
+Thierry
Hi Scott,
Quoted 15 lines · Scott Wood
Quoted 14 lines · Simon Glass
Hi Scott,
Quoted 10 lines · Scott Wood
Quoted 4 lines · Masahiro Yamada
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
Quoted 7 lines
Quoted 4 lines
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