mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
mptcp: return 0 instead of 'err' var
When 'err' is 0, it looks clearer to return '0' instead of the variable called 'err'. The behaviour is then not modified, just a clearer code. By doing this, we can also avoid false positive smatch warnings like this one: net/mptcp/pm_netlink.c:1169 mptcp_pm_parse_pm_addr_attr() warn: missing error code? 'err' Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Suggested-by: Mat Martineau <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
committed by
Jakub Kicinski
parent
8b34b52c17
commit
03e7d28cd2
@@ -1190,7 +1190,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
|
||||
|
||||
if (!tb[MPTCP_PM_ADDR_ATTR_FAMILY]) {
|
||||
if (!require_family)
|
||||
return err;
|
||||
return 0;
|
||||
|
||||
NL_SET_ERR_MSG_ATTR(info->extack, attr,
|
||||
"missing family");
|
||||
@@ -1224,7 +1224,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
|
||||
if (tb[MPTCP_PM_ADDR_ATTR_PORT])
|
||||
addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,
|
||||
|
||||
+1
-1
@@ -740,7 +740,7 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname,
|
||||
}
|
||||
release_sock(sk);
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
|
||||
|
||||
Reference in New Issue
Block a user