samples:bpf:remove unneeded variable
Subsystems (4)
PATCH 1/1 samples:bpf:remove unneeded variable
From: chiminghao <[email protected]>
return value form directly instead of
taking this in another redundant variable.
--- samples/bpf/xdp_redirect_cpu.bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
samples/bpf/xdp_redirect_cpu.bpf.c +1 -3
@@ -100,7 +100,6 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)void *data = (void *)(long )ctx->data;struct iphdr *iph = data + nh_off;struct udphdr *udph; -u16 dport;if (iph +1 > data_end)return 0 ;
@@ -111,8 +110,7 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)if (udph +1 > data_end)return 0 ; - dport =bpf_ntohs (udph->dest); -return dport; +return bpf_ntohs (udph->dest); } static __always_inline
Signature · 1 line
2.25.1
Quoted 8 lines · On Wed, Dec 8, 2021 at 5:55 PM <[email protected]> wrote:
From: chiminghao <[email protected]>
return value form directly instead of
taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by chiminghao <[email protected]>
Signed-off-by should contain properly capitalized full name, please update.
Also please use "samples/bpf: " patch prefix and use [PATCH bpf-next] to designate the destination kernel tree. Thanks.
Quoted 29 lines
--- samples/bpf/xdp_redirect_cpu.bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)samples/bpf/xdp_redirect_cpu.bpf.c +1
-4@@ -100,7 +100,6 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)void *data = (void *)(long )ctx->data;struct iphdr *iph = data + nh_off;struct udphdr *udph; -u16 dport;if (iph +1 > data_end)return 0 ;@@ -111,8 +110,7 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)if (udph +1 > data_end)return 0 ; - dport =bpf_ntohs (udph->dest); -return dport; +return bpf_ntohs (udph->dest); } static __always_inline --2.25.1
PATCH v2 1/1 samples/bpf:remove unneeded variable
From: Minghao Chi <[email protected]>
return value form directly instead of
taking this in another redundant variable.
--- samples/bpf/xdp_redirect_cpu.bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
samples/bpf/xdp_redirect_cpu.bpf.c +1 -3
@@ -100,7 +100,6 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)void *data = (void *)(long )ctx->data;struct iphdr *iph = data + nh_off;struct udphdr *udph; -u16 dport;if (iph +1 > data_end)return 0 ;
@@ -111,8 +110,7 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)if (udph +1 > data_end)return 0 ; - dport =bpf_ntohs (udph->dest); -return dport; +return bpf_ntohs (udph->dest); } static __always_inline
Signature · 1 line
2.25.1
Andrii Nakryiko
AppliedRe: [PATCHv2 bpf-next] samples/bpf:remove unneeded variable
Quoted 9 lines · On Thu, Dec 9, 2021 at 12:01 AM <[email protected]> wrote:
From: Minghao Chi <[email protected]>
return value form directly instead of
taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>---
Applied to bpf-next, thanks.
Quoted 28 lines
samples/bpf/xdp_redirect_cpu.bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)samples/bpf/xdp_redirect_cpu.bpf.c +1
-4@@ -100,7 +100,6 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)void *data = (void *)(long )ctx->data;struct iphdr *iph = data + nh_off;struct udphdr *udph; -u16 dport;if (iph +1 > data_end)return 0 ;@@ -111,8 +110,7 @@ u16 get_dest_port_ipv4_udp(struct xdp_md *ctx, u64 nh_off)if (udph +1 > data_end)return 0 ; - dport =bpf_ntohs (udph->dest); -return dport; +return bpf_ntohs (udph->dest); } static __always_inline --2.25.1
Re: [PATCHv2 bpf-next] samples/bpf:remove unneeded variable
In reply to [email protected]This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 9 lines · On Thu, 9 Dec 2021 08:00:51 +0000 you wrote:
From: Minghao Chi <[email protected]>
return value form directly instead of
taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>[...]
Here is the summary with links:
- [PATCHv2,bpf-next] samples/bpf:remove unneeded variable
https://git.kernel.org/bpf/bpf-next/c/ac55b3f00c32
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html