All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
@ 2017-11-06 13:26 Arnd Bergmann
  2017-11-06 14:31 ` Rob Herring
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arnd Bergmann @ 2017-11-06 13:26 UTC (permalink / raw)
  To: Vivien Didelot, David S . Miller, Rob Herring, Frank Rowand
  Cc: netdev, Arnd Bergmann, Sakari Ailus, Grant Likely,
	Rafael J. Wysocki, devicetree, linux-kernel

Commit a67e9472da42 ("of: Add array read functions with min/max size
limits") added a new interface for reading variable-length arrays from
DT properties. One user was added in dsa recently and this causes a
build error because that code can be built with CONFIG_OF disabled:

net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]

This adds a dummy functions for of_property_read_variable_u32_array()
and a few others that had been missing here. I decided to move
of_property_read_string() and of_property_read_string_helper() in the
process to make it easier to compare the two sets of function prototypes
to make sure they match.

Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
DT maintainers: there is currently a build break in the net-next tree
(from branch "dsa-parsing-stage") because of this, I think the best
way forward would be to get an Ack for this patch to get picked up
through the netdev trees.
---
 include/linux/of.h | 62 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 12 deletions(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 43b5034c6a1e..d3dea1d1e3a9 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -681,12 +681,6 @@ static inline int of_property_count_elems_of_size(const struct device_node *np,
 	return -ENOSYS;
 }
 
-static inline int of_property_read_u32_index(const struct device_node *np,
-			const char *propname, u32 index, u32 *out_value)
-{
-	return -ENOSYS;
-}
-
 static inline int of_property_read_u8_array(const struct device_node *np,
 			const char *propname, u8 *out_values, size_t sz)
 {
@@ -713,16 +707,14 @@ static inline int of_property_read_u64_array(const struct device_node *np,
 	return -ENOSYS;
 }
 
-static inline int of_property_read_string(const struct device_node *np,
-					  const char *propname,
-					  const char **out_string)
+static inline int of_property_read_u32_index(const struct device_node *np,
+			const char *propname, u32 index, u32 *out_value)
 {
 	return -ENOSYS;
 }
 
-static inline int of_property_read_string_helper(const struct device_node *np,
-						 const char *propname,
-						 const char **out_strs, size_t sz, int index)
+static inline int of_property_read_u64_index(const struct device_node *np,
+			const char *propname, u32 index, u64 *out_value)
 {
 	return -ENOSYS;
 }
@@ -750,12 +742,51 @@ static inline int of_n_size_cells(struct device_node *np)
 	return 0;
 }
 
+static inline int of_property_read_variable_u8_array(const struct device_node *np,
+					const char *propname, u8 *out_values,
+					size_t sz_min, size_t sz_max)
+{
+	return -ENOSYS;
+}
+
+static inline int of_property_read_variable_u16_array(const struct device_node *np,
+					const char *propname, u16 *out_values,
+					size_t sz_min, size_t sz_max)
+{
+	return -ENOSYS;
+}
+
+static inline int of_property_read_variable_u32_array(const struct device_node *np,
+					const char *propname,
+					u32 *out_values,
+					size_t sz_min,
+					size_t sz_max)
+{
+	return -ENOSYS;
+}
+
 static inline int of_property_read_u64(const struct device_node *np,
 				       const char *propname, u64 *out_value)
 {
 	return -ENOSYS;
 }
 
+static inline int of_property_read_variable_u64_array(const struct device_node *np,
+					const char *propname,
+					u64 *out_values,
+					size_t sz_min,
+					size_t sz_max)
+{
+	return -ENOSYS;
+}
+
+static inline int of_property_read_string(const struct device_node *np,
+					  const char *propname,
+					  const char **out_string)
+{
+	return -ENOSYS;
+}
+
 static inline int of_property_match_string(const struct device_node *np,
 					   const char *propname,
 					   const char *string)
@@ -763,6 +794,13 @@ static inline int of_property_match_string(const struct device_node *np,
 	return -ENOSYS;
 }
 
+static inline int of_property_read_string_helper(const struct device_node *np,
+						 const char *propname,
+						 const char **out_strs, size_t sz, int index)
+{
+	return -ENOSYS;
+}
+
 static inline struct device_node *of_parse_phandle(const struct device_node *np,
 						   const char *phandle_name,
 						   int index)
-- 
2.9.0

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

* Re: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
  2017-11-06 13:26 [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers Arnd Bergmann
@ 2017-11-06 14:31 ` Rob Herring
  2017-11-06 14:54   ` Vivien Didelot
  2017-11-08  4:36 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2017-11-06 14:31 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Vivien Didelot, David S . Miller, Frank Rowand, netdev,
	Sakari Ailus, Grant Likely, Rafael J. Wysocki, devicetree,
	linux-kernel

On Mon, Nov 6, 2017 at 7:26 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> Commit a67e9472da42 ("of: Add array read functions with min/max size
> limits") added a new interface for reading variable-length arrays from
> DT properties. One user was added in dsa recently and this causes a
> build error because that code can be built with CONFIG_OF disabled:
>
> net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
> net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
>
> This adds a dummy functions for of_property_read_variable_u32_array()
> and a few others that had been missing here. I decided to move
> of_property_read_string() and of_property_read_string_helper() in the
> process to make it easier to compare the two sets of function prototypes
> to make sure they match.
>
> Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> DT maintainers: there is currently a build break in the net-next tree
> (from branch "dsa-parsing-stage") because of this, I think the best
> way forward would be to get an Ack for this patch to get picked up
> through the netdev trees.

Fine by me.

> ---
>  include/linux/of.h | 62 +++++++++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 50 insertions(+), 12 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
@ 2017-11-06 14:54   ` Vivien Didelot
  0 siblings, 0 replies; 6+ messages in thread
From: Vivien Didelot @ 2017-11-06 14:54 UTC (permalink / raw)
  To: Arnd Bergmann, David S . Miller, Rob Herring, Frank Rowand
  Cc: netdev, Arnd Bergmann, Sakari Ailus, Grant Likely,
	Rafael J. Wysocki, devicetree, linux-kernel

Hi Arnd,

Arnd Bergmann <arnd@arndb.de> writes:

> Commit a67e9472da42 ("of: Add array read functions with min/max size
> limits") added a new interface for reading variable-length arrays from
> DT properties. One user was added in dsa recently and this causes a
> build error because that code can be built with CONFIG_OF disabled:
>
> net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
> net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
>
> This adds a dummy functions for of_property_read_variable_u32_array()
> and a few others that had been missing here. I decided to move
> of_property_read_string() and of_property_read_string_helper() in the
> process to make it easier to compare the two sets of function prototypes
> to make sure they match.
>
> Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I missed the missing stub for of_property_read_variable_u32_array with
!CONFIG_OF. Thank you for the quick fix!

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

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

* Re: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
@ 2017-11-06 14:54   ` Vivien Didelot
  0 siblings, 0 replies; 6+ messages in thread
From: Vivien Didelot @ 2017-11-06 14:54 UTC (permalink / raw)
  To: Arnd Bergmann, David S . Miller, Rob Herring, Frank Rowand
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Sakari Ailus,
	Grant Likely, Rafael J. Wysocki,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi Arnd,

Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> writes:

> Commit a67e9472da42 ("of: Add array read functions with min/max size
> limits") added a new interface for reading variable-length arrays from
> DT properties. One user was added in dsa recently and this causes a
> build error because that code can be built with CONFIG_OF disabled:
>
> net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
> net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
>
> This adds a dummy functions for of_property_read_variable_u32_array()
> and a few others that had been missing here. I decided to move
> of_property_read_string() and of_property_read_string_helper() in the
> process to make it easier to compare the two sets of function prototypes
> to make sure they match.
>
> Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

I missed the missing stub for of_property_read_variable_u32_array with
!CONFIG_OF. Thank you for the quick fix!

Reviewed-by: Vivien Didelot <vivien.didelot-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
@ 2017-11-06 14:54   ` Vivien Didelot
  0 siblings, 0 replies; 6+ messages in thread
From: Vivien Didelot @ 2017-11-06 14:54 UTC (permalink / raw)
  To: David S . Miller, Rob Herring, Frank Rowand
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Sakari Ailus,
	Grant Likely, Rafael J. Wysocki,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi Arnd,

Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> writes:

> Commit a67e9472da42 ("of: Add array read functions with min/max size
> limits") added a new interface for reading variable-length arrays from
> DT properties. One user was added in dsa recently and this causes a
> build error because that code can be built with CONFIG_OF disabled:
>
> net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
> net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
>
> This adds a dummy functions for of_property_read_variable_u32_array()
> and a few others that had been missing here. I decided to move
> of_property_read_string() and of_property_read_string_helper() in the
> process to make it easier to compare the two sets of function prototypes
> to make sure they match.
>
> Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

I missed the missing stub for of_property_read_variable_u32_array with
!CONFIG_OF. Thank you for the quick fix!

Reviewed-by: Vivien Didelot <vivien.didelot-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers
  2017-11-06 13:26 [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers Arnd Bergmann
  2017-11-06 14:31 ` Rob Herring
  2017-11-06 14:54   ` Vivien Didelot
@ 2017-11-08  4:36 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-11-08  4:36 UTC (permalink / raw)
  To: arnd
  Cc: vivien.didelot, robh+dt, frowand.list, netdev, sakari.ailus,
	grant.likely, rafael.j.wysocki, devicetree, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon,  6 Nov 2017 14:26:10 +0100

> Commit a67e9472da42 ("of: Add array read functions with min/max size
> limits") added a new interface for reading variable-length arrays from
> DT properties. One user was added in dsa recently and this causes a
> build error because that code can be built with CONFIG_OF disabled:
> 
> net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
> net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
> 
> This adds a dummy functions for of_property_read_variable_u32_array()
> and a few others that had been missing here. I decided to move
> of_property_read_string() and of_property_read_string_helper() in the
> process to make it easier to compare the two sets of function prototypes
> to make sure they match.
> 
> Fixes: 975e6e32215e ("net: dsa: rework switch parsing")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks Arnd.

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

end of thread, other threads:[~2017-11-08  4:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 13:26 [PATCH] [net-next?] of: add of_property_read_variable_* dummy helpers Arnd Bergmann
2017-11-06 14:31 ` Rob Herring
2017-11-06 14:54 ` Vivien Didelot
2017-11-06 14:54   ` Vivien Didelot
2017-11-06 14:54   ` Vivien Didelot
2017-11-08  4:36 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.