diff mbox series

net: bridge: remove redundant check of f->dst

Message ID tencent_616D84217798828E5D1021857C528B713406@qq.com (mailing list archive)
State Accepted
Commit e7d96e750f2bc9b951290c90df421ac5e9adc3ed
Delegated to: Netdev Maintainers
Headers show
Series net: bridge: remove redundant check of f->dst | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be 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: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
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: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 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
netdev/contest success net-next-2024-04-24--15-00 (tests: 995)

Commit Message

linke li April 23, 2024, 10:53 a.m. UTC
In br_fill_forward_path(), f->dst is checked not to be NULL, then
immediately read using READ_ONCE and checked again. The first check is
useless, so this patch aims to remove the redundant check of f->dst.

Signed-off-by: linke li <lilinke99@qq.com>
---
 net/bridge/br_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikolay Aleksandrov April 23, 2024, 11:12 a.m. UTC | #1
On 4/23/24 13:53, linke li wrote:
> In br_fill_forward_path(), f->dst is checked not to be NULL, then
> immediately read using READ_ONCE and checked again. The first check is
> useless, so this patch aims to remove the redundant check of f->dst.
> 
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
>   net/bridge/br_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index 65cee0ad3c1b..ae33b30ff87c 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -405,7 +405,7 @@ static int br_fill_forward_path(struct net_device_path_ctx *ctx,
>   	br_vlan_fill_forward_path_pvid(br, ctx, path);
>   
>   	f = br_fdb_find_rcu(br, ctx->daddr, path->bridge.vlan_id);
> -	if (!f || !f->dst)
> +	if (!f)
>   		return -1;
>   
>   	dst = READ_ONCE(f->dst);

This patch should target net-next (PATCH net-next in subject).
Other than that the patch seems fine.

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
linke li April 23, 2024, 11:58 a.m. UTC | #2
Thanks for your advice! Should I submit another patch with subject
"[PATCH net-next] net: bridge: remove redundant check of f->dst" or
"[PATCH net-next v2] net: bridge: remove redundant check of f->dst"?
Nikolay Aleksandrov April 23, 2024, 12:17 p.m. UTC | #3
On 4/23/24 14:58, linke li wrote:
> Thanks for your advice! Should I submit another patch with subject
> "[PATCH net-next] net: bridge: remove redundant check of f->dst" or
> "[PATCH net-next v2] net: bridge: remove redundant check of f->dst"?
> 

Please don't delete the whole thread, just reply below it and snip any 
unnecessary big chunks if needed. As to your question - maintainers
usually take care of this so re-submission is not necessary but in case
they request a re-submission please wait 24 hours before sending another
version. v2 is expected in the subject, also please add a small 
description of what changed in v2.

Thanks,
  Nik
patchwork-bot+netdevbpf@kernel.org April 25, 2024, 12:20 p.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 23 Apr 2024 18:53:26 +0800 you wrote:
> In br_fill_forward_path(), f->dst is checked not to be NULL, then
> immediately read using READ_ONCE and checked again. The first check is
> useless, so this patch aims to remove the redundant check of f->dst.
> 
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
>  net/bridge/br_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - net: bridge: remove redundant check of f->dst
    https://git.kernel.org/netdev/net-next/c/e7d96e750f2b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 65cee0ad3c1b..ae33b30ff87c 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -405,7 +405,7 @@  static int br_fill_forward_path(struct net_device_path_ctx *ctx,
 	br_vlan_fill_forward_path_pvid(br, ctx, path);
 
 	f = br_fdb_find_rcu(br, ctx->daddr, path->bridge.vlan_id);
-	if (!f || !f->dst)
+	if (!f)
 		return -1;
 
 	dst = READ_ONCE(f->dst);