diff mbox series

[net-next] fib: rules: remove repeated assignment in fib_nl2rule

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1141 this patch: 1141
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Jan. 5, 2024, 6:56 a.m. UTC
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(-)

Comments

Simon Horman Jan. 5, 2024, 9:39 p.m. UTC | #1
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>
David Ahern Jan. 6, 2024, 4:08 p.m. UTC | #2
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>
patchwork-bot+netdevbpf@kernel.org Jan. 7, 2024, 3:20 p.m. UTC | #3
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 mbox series

Patch

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;