[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a7a985b4-d22f-4918-a837-893c4e7efe05@lunn.ch>
Date: Fri, 30 Aug 2024 16:44:22 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: f.fainelli@...il.com, olteanv@...il.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
krzk@...nel.org, jic23@...nel.org
Subject: Re: [PATCH net-next v2 RESEND] net: dsa: Simplify with scoped for
each OF child loop
On Fri, Aug 30, 2024 at 03:00:37PM +0800, Jinjie Ruan wrote:
> Use scoped for_each_available_child_of_node_scoped() when iterating over
> device nodes to make code a bit simpler.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
> v1 -> v2 RESNED:
> - Remove the goto.
> - next -> net-next
> ---
> net/dsa/dsa.c | 24 ++++++++++--------------
> 1 file changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> index 668c729946ea..24f566838621 100644
> --- a/net/dsa/dsa.c
> +++ b/net/dsa/dsa.c
> @@ -1264,9 +1264,8 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
> static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
> struct device_node *dn)
> {
> - struct device_node *ports, *port;
> + struct device_node *ports;
> struct dsa_port *dp;
> - int err = 0;
Why?
Patches should be small, simple, obviously correct. This change makes
the patch more complex, harder to review, and less obviously correct.
All these patches have questionable value. Most probably don't fix
anything which is broken. They are using up a lot of
Reviewer/Maintainer time. Don't make it worse by making unneeded
changes.
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists