Message ID | 20240105065634.529045-1-shaozhengchao@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | c4a5ee9c09aa11f394b57674f525085034f5f68b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] fib: rules: remove repeated assignment in fib_nl2rule | expand |
On Fri, Jan 05, 2024 at 02:56:34PM +0800, Zhengchao Shao wrote: > In fib_nl2rule(), 'err' variable has been set to -EINVAL during > declaration, and no need to set the 'err' variable to -EINVAL again. > So, remove it. > > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Thanks, I agree that this seems unnecessary. Reviewed-by: Simon Horman <horms@kernel.org>
On 1/4/24 11:56 PM, Zhengchao Shao wrote: > In fib_nl2rule(), 'err' variable has been set to -EINVAL during > declaration, and no need to set the 'err' variable to -EINVAL again. > So, remove it. > > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> > --- > net/core/fib_rules.c | 1 - > 1 file changed, 1 deletion(-) > Reviewed-by: David Ahern <dsahern@kernel.org>
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Fri, 5 Jan 2024 14:56:34 +0800 you wrote: > In fib_nl2rule(), 'err' variable has been set to -EINVAL during > declaration, and no need to set the 'err' variable to -EINVAL again. > So, remove it. > > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> > --- > net/core/fib_rules.c | 1 - > 1 file changed, 1 deletion(-) Here is the summary with links: - [net-next] fib: rules: remove repeated assignment in fib_nl2rule https://git.kernel.org/netdev/net-next/c/c4a5ee9c09aa You are awesome, thank you!
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 75282222e0b4..a50a0bde8db1 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -594,7 +594,6 @@ static int fib_nl2rule(struct sk_buff *skb, struct nlmsghdr *nlh, if (tb[FRA_TUN_ID]) nlrule->tun_id = nla_get_be64(tb[FRA_TUN_ID]); - err = -EINVAL; if (tb[FRA_L3MDEV] && fib_nl2rule_l3mdev(tb[FRA_L3MDEV], nlrule, extack) < 0) goto errout_free;
In fib_nl2rule(), 'err' variable has been set to -EINVAL during declaration, and no need to set the 'err' variable to -EINVAL again. So, remove it. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> --- net/core/fib_rules.c | 1 - 1 file changed, 1 deletion(-)