net: dsa: print error on invalid port index
Subsystems (3)
PATCH 1/1 net: dsa: print error on invalid port index
From: Rafał Miłecki <[email protected]>
Looking for an -EINVAL all over the dsa code could take hours for inexperienced DSA users.
Signed-off-by Rafał Miłecki <[email protected]>
--- net/dsa/dsa2.c | 2 ++ 1 file changed, 2 insertions(+)
net/dsa/dsa2.c +2 -0
@@ -783,6 +783,8 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds, goto out_put_node;if (reg >= ds->num_ports) { +dev_err (ds->dev,"port %pOF index %u exceeds num_ports (%zu)\n" , + port, reg, ds->num_ports); err = -EINVAL ; goto out_put_node; }
Signature · 1 line
2.26.2
Quoted 4 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Looking for an
-EINVALall over the dsa code could take hours for inexperienced DSA users.
Following this argument, you should add dev_err() by every -EINVAL.
Quoted 1 line
Signed-off-by Rafał Miłecki <[email protected]>
Reviewed-by Andrew Lunn <[email protected]>
Andrew
Quoted 11 lines · On Wed, 6 Jan 2021 23:33:07 +0100 Andrew Lunn wrote:
Quoted 4 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Looking for an
-EINVALall over the dsa code could take hours for inexperienced DSA users.Following this argument, you should add
dev_err()by every-EINVAL.Quoted 1 line
Signed-off-by Rafał Miłecki <[email protected]>Reviewed-by Andrew Lunn <[email protected]>
Applied, thanks!