diff mbox series

[v1,1/1] device property: Make fwnode_graph_for_each_endpoint() consistent

Message ID 20230117152120.42531-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit 52af7863508e94f3e05e43a3f2f3943a71dcffab
Headers show
Series [v1,1/1] device property: Make fwnode_graph_for_each_endpoint() consistent | expand

Commit Message

Andy Shevchenko Jan. 17, 2023, 3:21 p.m. UTC
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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/property.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Heikki Krogerus Jan. 19, 2023, 9:26 a.m. UTC | #1
On Tue, Jan 17, 2023 at 05:21:20PM +0200, Andy Shevchenko wrote:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

FWIW:

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  include/linux/property.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/property.h b/include/linux/property.h
> index 37179e3abad5..f090419818a2 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -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.39.0
Sakari Ailus Jan. 19, 2023, 11:17 a.m. UTC | #2
On Tue, Jan 17, 2023 at 05:21:20PM +0200, Andy Shevchenko wrote:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Greg Kroah-Hartman Jan. 19, 2023, 1:36 p.m. UTC | #3
On Wed, Jan 18, 2023 at 08:55:19PM +0100, Rafael J. Wysocki wrote:
> On Tue, Jan 17, 2023 at 4:21 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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
diff mbox series

Patch

diff --git a/include/linux/property.h b/include/linux/property.h
index 37179e3abad5..f090419818a2 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -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);