* [PATCH -next] of/fdt: declared return type does not match actual return type
@ 2022-08-01 12:05 Xu Qiang
2022-08-01 12:05 ` Xu Qiang
0 siblings, 1 reply; 3+ messages in thread
From: Xu Qiang @ 2022-08-01 12:05 UTC (permalink / raw)
To: robh+dt, frowand.list
Cc: linux-kernel, devicetree, guohanjun, weiyongjun1, xuqiang36
The commit 649cab56de8e (“of: properly check for error returned
by fdt_get_name()”) changed the return value type from bool to int,
but forgot to change the return value simultaneously.
populate_node was only called in unflatten_dt_nodes, and returns
with values greater than or equal to 0 were discarded without further
processing. Considering that return 0 usually indicates success,
return 0 instead of return true.
Fixes: 649cab56de8e (“of: properly check for error returned by fdt_get_name()”)
Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
drivers/of/fdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 22b3d35a5e76..4fe448d8d2ae 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -246,7 +246,7 @@ static int populate_node(const void *blob,
}
*pnp = np;
- return true;
+ return 0;
}
static void reverse_nodes(struct device_node *parent)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH -next] of/fdt: declared return type does not match actual return type
2022-08-01 12:05 [PATCH -next] of/fdt: declared return type does not match actual return type Xu Qiang
@ 2022-08-01 12:05 ` Xu Qiang
2022-08-01 16:13 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Xu Qiang @ 2022-08-01 12:05 UTC (permalink / raw)
To: robh+dt, frowand.list
Cc: linux-kernel, devicetree, guohanjun, weiyongjun1, xuqiang36
The commit 649cab56de8e (“of: properly check for error returned
by fdt_get_name()”) changed the return value type from bool to int,
but forgot to change the return value simultaneously.
populate_node was only called in unflatten_dt_nodes, and returns
with values greater than or equal to 0 were discarded without further
processing. Considering that return 0 usually indicates success,
return 0 instead of return true.
Fixes: 649cab56de8e (“of: properly check for error returned by fdt_get_name()”)
Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
drivers/of/fdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 22b3d35a5e76..4fe448d8d2ae 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -246,7 +246,7 @@ static int populate_node(const void *blob,
}
*pnp = np;
- return true;
+ return 0;
}
static void reverse_nodes(struct device_node *parent)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] of/fdt: declared return type does not match actual return type
2022-08-01 12:05 ` Xu Qiang
@ 2022-08-01 16:13 ` Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2022-08-01 16:13 UTC (permalink / raw)
To: Xu Qiang
Cc: linux-kernel, frowand.list, weiyongjun1, robh+dt, guohanjun,
devicetree
On Mon, 01 Aug 2022 12:05:06 +0000, Xu Qiang wrote:
> The commit 649cab56de8e (“of: properly check for error returned
> by fdt_get_name()”) changed the return value type from bool to int,
> but forgot to change the return value simultaneously.
>
> populate_node was only called in unflatten_dt_nodes, and returns
> with values greater than or equal to 0 were discarded without further
> processing. Considering that return 0 usually indicates success,
> return 0 instead of return true.
>
> Fixes: 649cab56de8e (“of: properly check for error returned by fdt_get_name()”)
> Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
> ---
> drivers/of/fdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-01 16:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 12:05 [PATCH -next] of/fdt: declared return type does not match actual return type Xu Qiang
2022-08-01 12:05 ` Xu Qiang
2022-08-01 16:13 ` Rob Herring
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).