Thread (51 messages) flat view 51 messages, 5 authors, 2022-09-22

Re: [PATCH rfc v0 6/9] net: dsa: qca8k: Refactor sequence number mismatch to use error code

From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-09-20 00:05:25

quoted
-	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help