mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] Revert "of: Add of_property_for_each_phandle() iterator"
@ 2020-07-04  7:15 Ahmad Fatoum
  2020-07-05 12:45 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2020-07-04  7:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Trent Piepho

Codebase is meant to be gnu89, but this was only enforced starting
with bc4840e98b94 ("kbuild: add -Wmissing-prototypes and -std=gnu89
to KBUILD_HOSTCFLAGS"). Since then, use of this macro would yield a
compile error, because of the initialization inside the for-loop,
which is a C99 feature. There hasn't been any users for the macro
since it was added in 2016, thus drop it.

This reverts commit d5f9415b04846661522141ea428f74e3c618fa9e.

Cc: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
 fix Name in CC
---
 include/of.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/include/of.h b/include/of.h
index 08bbeaf4d21b..d548e517896b 100644
--- a/include/of.h
+++ b/include/of.h
@@ -902,17 +902,6 @@ static inline int of_property_read_u32(const struct device_node *np,
 		s;						\
 		s = of_prop_next_string(prop, s))
 
-/*
- * struct device_node *n;
- *
- * of_property_for_each_phandle(np, root, "propname", n)
- *         printk("phandle points to: %s\n", n->full_name);
- */
-#define of_property_for_each_phandle(np, root, propname, n)	\
-	for (int _i = 0; 					\
-	     (n = of_parse_phandle_from(np, root, propname, _i));\
-	     _i++)
-
 static inline int of_property_write_u8(struct device_node *np,
 				       const char *propname, u8 value)
 {
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH v2] Revert "of: Add of_property_for_each_phandle() iterator"
  2020-07-04  7:15 [PATCH v2] Revert "of: Add of_property_for_each_phandle() iterator" Ahmad Fatoum
@ 2020-07-05 12:45 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-07-05 12:45 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Trent Piepho

On Sat, Jul 04, 2020 at 09:15:05AM +0200, Ahmad Fatoum wrote:
> Codebase is meant to be gnu89, but this was only enforced starting
> with bc4840e98b94 ("kbuild: add -Wmissing-prototypes and -std=gnu89
> to KBUILD_HOSTCFLAGS"). Since then, use of this macro would yield a
> compile error, because of the initialization inside the for-loop,
> which is a C99 feature. There hasn't been any users for the macro
> since it was added in 2016, thus drop it.
> 
> This reverts commit d5f9415b04846661522141ea428f74e3c618fa9e.
> 
> Cc: Trent Piepho <tpiepho@kymetacorp.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> v1 -> v2:
>  fix Name in CC
> ---
>  include/of.h | 11 -----------
>  1 file changed, 11 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/include/of.h b/include/of.h
> index 08bbeaf4d21b..d548e517896b 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -902,17 +902,6 @@ static inline int of_property_read_u32(const struct device_node *np,
>  		s;						\
>  		s = of_prop_next_string(prop, s))
>  
> -/*
> - * struct device_node *n;
> - *
> - * of_property_for_each_phandle(np, root, "propname", n)
> - *         printk("phandle points to: %s\n", n->full_name);
> - */
> -#define of_property_for_each_phandle(np, root, propname, n)	\
> -	for (int _i = 0; 					\
> -	     (n = of_parse_phandle_from(np, root, propname, _i));\
> -	     _i++)
> -
>  static inline int of_property_write_u8(struct device_node *np,
>  				       const char *propname, u8 value)
>  {
> -- 
> 2.27.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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] 2+ messages in thread

end of thread, other threads:[~2020-07-05 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04  7:15 [PATCH v2] Revert "of: Add of_property_for_each_phandle() iterator" Ahmad Fatoum
2020-07-05 12:45 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox