devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libfdt: fix fdt_stringlist_count()
@ 2016-10-17  6:08 Masahiro Yamada
       [not found] ` <1476684504-3626-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2016-10-17  6:08 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA; +Cc: Masahiro Yamada

If fdt_getprop() fails, negative error code should be returned.

Signed-off-by: Masahiro Yamada <yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
---

 libfdt/fdt_ro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 0459098..db8d10f 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -571,7 +571,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property)
 
 	list = fdt_getprop(fdt, nodeoffset, property, &length);
 	if (!list)
-		return -length;
+		return length;
 
 	end = list + length;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] libfdt: fix fdt_stringlist_search()
       [not found] ` <1476684504-3626-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
@ 2016-10-17  6:08   ` Masahiro Yamada
  2016-10-17  9:58   ` [PATCH 1/2] libfdt: fix fdt_stringlist_count() David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2016-10-17  6:08 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA; +Cc: Masahiro Yamada

If fdt_getprop() fails, negative error code should be returned.

Signed-off-by: Masahiro Yamada <yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
---

 libfdt/fdt_ro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index db8d10f..3d00d2e 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -597,7 +597,7 @@ int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
 
 	list = fdt_getprop(fdt, nodeoffset, property, &length);
 	if (!list)
-		return -length;
+		return length;
 
 	len = strlen(string) + 1;
 	end = list + length;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] libfdt: fix fdt_stringlist_count()
       [not found] ` <1476684504-3626-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
  2016-10-17  6:08   ` [PATCH 2/2] libfdt: fix fdt_stringlist_search() Masahiro Yamada
@ 2016-10-17  9:58   ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2016-10-17  9:58 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

On Mon, Oct 17, 2016 at 03:08:23PM +0900, Masahiro Yamada wrote:
> If fdt_getprop() fails, negative error code should be returned.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>

Nice catch.  Both fixes applied to master.

> ---
> 
>  libfdt/fdt_ro.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
> index 0459098..db8d10f 100644
> --- a/libfdt/fdt_ro.c
> +++ b/libfdt/fdt_ro.c
> @@ -571,7 +571,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property)
>  
>  	list = fdt_getprop(fdt, nodeoffset, property, &length);
>  	if (!list)
> -		return -length;
> +		return length;
>  
>  	end = list + length;
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-17  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17  6:08 [PATCH 1/2] libfdt: fix fdt_stringlist_count() Masahiro Yamada
     [not found] ` <1476684504-3626-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2016-10-17  6:08   ` [PATCH 2/2] libfdt: fix fdt_stringlist_search() Masahiro Yamada
2016-10-17  9:58   ` [PATCH 1/2] libfdt: fix fdt_stringlist_count() David Gibson

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).