linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/platform: fix compilation warning of of_link_property()
@ 2019-08-08 14:18 Anders Roxell
  2019-08-08 16:09 ` Frank Rowand
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Roxell @ 2019-08-08 14:18 UTC (permalink / raw)
  To: robh+dt, frowand.list; +Cc: devicetree, linux-kernel, Anders Roxell

GCC warns that a negative integer can be returned but the
of_link_property() function should return a boolean.

../drivers/of/platform.c: In function ‘of_link_property’:
../drivers/of/platform.c:650:18: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
  return done ? 0 : -ENODEV;

Rework so function of_link_property() return an integer instead of a boolean.

Fixes: 690ff7881b26 ("of/platform: Add functional dependency link from DT bindings")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 21838226d68a..86fb8ab8c012 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -625,7 +625,7 @@ static const struct supplier_bindings bindings[] = {
 	{ },
 };
 
-static bool of_link_property(struct device *dev, struct device_node *con_np,
+static int of_link_property(struct device *dev, struct device_node *con_np,
 			     const char *prop)
 {
 	struct device_node *phandle;
-- 
2.20.1


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

* Re: [PATCH] of/platform: fix compilation warning of of_link_property()
  2019-08-08 14:18 [PATCH] of/platform: fix compilation warning of of_link_property() Anders Roxell
@ 2019-08-08 16:09 ` Frank Rowand
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Rowand @ 2019-08-08 16:09 UTC (permalink / raw)
  To: Anders Roxell, robh+dt; +Cc: devicetree, linux-kernel

On 8/8/19 7:18 AM, Anders Roxell wrote:
> GCC warns that a negative integer can be returned but the
> of_link_property() function should return a boolean.
> 
> ../drivers/of/platform.c: In function ‘of_link_property’:
> ../drivers/of/platform.c:650:18: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
>   return done ? 0 : -ENODEV;
> 
> Rework so function of_link_property() return an integer instead of a boolean.
> 
> Fixes: 690ff7881b26 ("of/platform: Add functional dependency link from DT bindings")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  drivers/of/platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 21838226d68a..86fb8ab8c012 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -625,7 +625,7 @@ static const struct supplier_bindings bindings[] = {
>  	{ },
>  };
>  
> -static bool of_link_property(struct device *dev, struct device_node *con_np,
> +static int of_link_property(struct device *dev, struct device_node *con_np,
>  			     const char *prop)
>  {
>  	struct device_node *phandle;
> 

Hi Anders,

Thanks for catching this.

Another patch was submitted to fix this just before your patch.

-Frank

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

end of thread, other threads:[~2019-08-08 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 14:18 [PATCH] of/platform: fix compilation warning of of_link_property() Anders Roxell
2019-08-08 16:09 ` Frank Rowand

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