Skip to contentSkip to conversation

device property: Make fwnode_graph_for_each_endpoint() consistent

PATCH In review Andy Shevchenko 5 participants 5 messages Jan 17, 2023 – Jan 19, 2023

Subsystems (3)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 device property: Make fwnode_graph_for_each_endpoint() consistent

Make fwnode_graph_for_each_endpoint() consistent with the rest of for_each_*() definitions in the file, i.e. use the form of

	for (iter = func(NULL); iter; \
	     iter = func(iter))

as it's done in all the rest of the similar macro definitions.

---
 include/linux/property.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/property.h +3 -3
index 37179e3abad5..f090419818a2 100644
@@ -436,9 +436,9 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode,
 					     unsigned long flags);
 
-#define fwnode_graph_for_each_endpoint(fwnode, child)			\
-	for (child = NULL;						\
-	     (child = fwnode_graph_get_next_endpoint(fwnode, child)); )
+#define fwnode_graph_for_each_endpoint(fwnode, child)				\
+	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\
+	     child = fwnode_graph_get_next_endpoint(fwnode, child))
 
 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
 				struct fwnode_endpoint *endpoint);
Signature · 1 line
2.39.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Andy Shevchenko

Make fwnode_graph_for_each_endpoint() consistent with the rest of for_each_*() definitions in the file, i.e. use the form of

for (iter = func(NULL); iter; \
iter = func(iter))

as it's done in all the rest of the similar macro definitions.

and I think that you need to resend it and CC Greg (who picks up device property patches nowadays).

Quoted 22 lines
---
 include/linux/property.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/property.h +3 -4
index 37179e3abad5..f090419818a2 100644
@@ -436,9 +436,9 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode,
                                             unsigned long flags);
 
-#define fwnode_graph_for_each_endpoint(fwnode, child)                  \
-       for (child = NULL;                                              \
-            (child = fwnode_graph_get_next_endpoint(fwnode, child)); )
+#define fwnode_graph_for_each_endpoint(fwnode, child)                          \
+       for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;       \
+            child = fwnode_graph_get_next_endpoint(fwnode, child))
 
 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
                                struct fwnode_endpoint *endpoint);
--
#2 lore raw
Quoted 9 lines · Rafael J. Wysocki
Quoted 7 lines · Andy Shevchenko

Make fwnode_graph_for_each_endpoint() consistent with the rest of for_each_*() definitions in the file, i.e. use the form of

for (iter = func(NULL); iter; \
iter = func(iter))

Quoted 8 lines
Quoted 3 lines

as it's done in all the rest of the similar macro definitions.

and I think that you need to resend it and CC Greg (who picks up device property patches nowadays).

I can grab it from here, thanks.

greg k-h

reviewer Acked-by on v1 1/1
#3 lore raw
In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

Make fwnode_graph_for_each_endpoint() consistent with the rest of for_each_*() definitions in the file, i.e. use the form of

	for (iter = func(NULL); iter; \
	     iter = func(iter))

as it's done in all the rest of the similar macro definitions.

FWIW:

Quoted 23 lines
---
 include/linux/property.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/property.h +3 -3
index 37179e3abad5..f090419818a2 100644
@@ -436,9 +436,9 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode,
 					     unsigned long flags);
 
-#define fwnode_graph_for_each_endpoint(fwnode, child)			\
-	for (child = NULL;						\
-	     (child = fwnode_graph_get_next_endpoint(fwnode, child)); )
+#define fwnode_graph_for_each_endpoint(fwnode, child)				\
+	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\
+	     child = fwnode_graph_get_next_endpoint(fwnode, child))
 
 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
 				struct fwnode_endpoint *endpoint);
Signature · 1 line
2.39.0
Signature · 1 line
heikki