* [PATCH] fixup! of: implement new of_property_sprintf
@ 2022-01-14 8:57 Ahmad Fatoum
2022-01-14 10:29 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2022-01-14 8:57 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
Otherwise, tools like of_dump will consider the output to be byte
arrays.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
drivers/of/base.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 06e37b0fca4a..80465d6d5062 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2285,6 +2285,8 @@ int of_property_sprintf(struct device_node *np,
if (len < 0)
return -ENOMEM;
+ len++; /* trailing NUL */
+
pp = of_find_property(np, propname, NULL);
of_delete_property(pp);
--
2.33.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fixup! of: implement new of_property_sprintf
2022-01-14 8:57 [PATCH] fixup! of: implement new of_property_sprintf Ahmad Fatoum
@ 2022-01-14 10:29 ` Sascha Hauer
0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2022-01-14 10:29 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Fri, Jan 14, 2022 at 09:57:35AM +0100, Ahmad Fatoum wrote:
> Otherwise, tools like of_dump will consider the output to be byte
> arrays.
>
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> drivers/of/base.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied, thanks.
I've rewritten the commit message as it's too late for a fixup.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] fixup! of: implement new of_property_sprintf
2021-12-09 10:57 [PATCH 3/3] " Ahmad Fatoum
@ 2021-12-15 20:16 ` Ahmad Fatoum
0 siblings, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2021-12-15 20:16 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
Otherwise, tools like of_dump will consider the output to be byte
arrays.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
drivers/of/base.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 06e37b0fca4a..80465d6d5062 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2285,6 +2285,8 @@ int of_property_sprintf(struct device_node *np,
if (len < 0)
return -ENOMEM;
+ len++; /* trailing NUL */
+
pp = of_find_property(np, propname, NULL);
of_delete_property(pp);
--
2.33.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-14 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14 8:57 [PATCH] fixup! of: implement new of_property_sprintf Ahmad Fatoum
2022-01-14 10:29 ` Sascha Hauer
-- strict thread matches above, loose matches on Subject: below --
2021-12-09 10:57 [PATCH 3/3] " Ahmad Fatoum
2021-12-15 20:16 ` [PATCH] fixup! " Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox