Message ID | 20210106090915.21439-1-zajec5@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [next] net: dsa: print error on invalid port index | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Guessed tree name to be net-next |
netdev/subject_prefix | warning | Target tree name not specified in the subject |
netdev/cc_maintainers | success | CCed 7 of 7 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
On Wed, Jan 06, 2021 at 10:09:15AM +0100, Rafał Miłecki wrote: > From: Rafał Miłecki <rafal@milecki.pl> > > Looking for an -EINVAL all over the dsa code could take hours for > inexperienced DSA users. Following this argument, you should add dev_err() by every -EINVAL. > Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On Wed, 6 Jan 2021 23:33:07 +0100 Andrew Lunn wrote: > On Wed, Jan 06, 2021 at 10:09:15AM +0100, Rafał Miłecki wrote: > > From: Rafał Miłecki <rafal@milecki.pl> > > > > Looking for an -EINVAL all over the dsa code could take hours for > > inexperienced DSA users. > > Following this argument, you should add dev_err() by every -EINVAL. > > > Signed-off-by: Rafał Miłecki <rafal@milecki.pl> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> Applied, thanks!
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 183003e45762..01f21b0b379a 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -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; }