[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YykDvXQXt8EKwtgZ@lunn.ch>
Date: Tue, 20 Sep 2022 02:05:17 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: "mattias.forsblad@...il.com" <mattias.forsblad@...il.com>,
netdev <netdev@...r.kernel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Christian Marangi <ansuelsmth@...il.com>
Subject: Re: [PATCH rfc v0 6/9] net: dsa: qca8k: Refactor sequence number
mismatch to use error code
> > - if (!ack)
> > - return -EINVAL;
> > + if (err)
> > + return -ret;
>
> Probably "if (err) return -ret" is not what you intend. We know ret is 0,
> we just checked for it earlier.
Good catch. Thanks.
>
> Also, maybe a variable named "match" would be more expressive? This
> shows how easy it is to make mistakes, mixing "err" with "ret" in the
> same function.
A lot of this code gets removed in the next patch. I'm just trying to
keep to lots of small, easy to review patches, which in this case
results in some not so nice intermediary state, but the next patch
cleans it up.
Andrew
Powered by blists - more mailing lists