Skip to content

Commit 03e7d28

Browse files
matttbekuba-moo
authored andcommitted
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]>
1 parent 8b34b52 commit 03e7d28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

net/mptcp/pm_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
11901190

11911191
if (!tb[MPTCP_PM_ADDR_ATTR_FAMILY]) {
11921192
if (!require_family)
1193-
return err;
1193+
return 0;
11941194

11951195
NL_SET_ERR_MSG_ATTR(info->extack, attr,
11961196
"missing family");
@@ -1224,7 +1224,7 @@ static int mptcp_pm_parse_pm_addr_attr(struct nlattr *tb[],
12241224
if (tb[MPTCP_PM_ADDR_ATTR_PORT])
12251225
addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
12261226

1227-
return err;
1227+
return 0;
12281228
}
12291229

12301230
int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info,

net/mptcp/sockopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ static int mptcp_setsockopt_v4_set_tos(struct mptcp_sock *msk, int optname,
740740
}
741741
release_sock(sk);
742742

743-
return err;
743+
return 0;
744744
}
745745

746746
static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,

0 commit comments

Comments
 (0)