2023-01-17 15:55:12

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 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.

Signed-off-by: Andy Shevchenko <[email protected]>
---
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


2023-01-18 20:21:20

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] device property: Make fwnode_graph_for_each_endpoint() consistent

On Tue, Jan 17, 2023 at 4:21 PM Andy Shevchenko
<[email protected]> 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 <[email protected]>

Acked-by: Rafael J. Wysocki <[email protected]>

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

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

2023-01-19 10:38:39

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] device property: Make fwnode_graph_for_each_endpoint() consistent

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 <[email protected]>

FWIW:

Acked-by: Heikki Krogerus <[email protected]>

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

--
heikki

2023-01-19 12:28:51

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] device property: Make fwnode_graph_for_each_endpoint() consistent

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 <[email protected]>

Acked-by: Sakari Ailus <[email protected]>

--
Sakari Ailus

2023-01-19 14:42:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] device property: Make fwnode_graph_for_each_endpoint() consistent

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
> <[email protected]> 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 <[email protected]>
>
> Acked-by: Rafael J. Wysocki <[email protected]>
>
> 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