[PATCH bpf-next] bpf: Remove redundant assignment to meta.seq in __task_seq_show()

Yuntao Wang posted 1 patch 4 years, 2 months ago
kernel/bpf/bpf_iter.c  | 2 +-
kernel/bpf/task_iter.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
[PATCH bpf-next] bpf: Remove redundant assignment to meta.seq in __task_seq_show()
Posted by Yuntao Wang 4 years, 2 months ago
The seq argument is assigned to meta.seq twice, the second one is
redundant, remove it.

This patch also removes a redundant space in bpf_iter_link_attach().

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
---
 kernel/bpf/bpf_iter.c  | 2 +-
 kernel/bpf/task_iter.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index dea920b3b840..d5d96ceca105 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -545,7 +545,7 @@ int bpf_iter_link_attach(const union bpf_attr *attr, bpfptr_t uattr,
 	bpf_link_init(&link->link, BPF_LINK_TYPE_ITER, &bpf_iter_link_lops, prog);
 	link->tinfo = tinfo;
 
-	err  = bpf_link_prime(&link->link, &link_primer);
+	err = bpf_link_prime(&link->link, &link_primer);
 	if (err) {
 		kfree(link);
 		return err;
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
index d94696198ef8..8c921799def4 100644
--- a/kernel/bpf/task_iter.c
+++ b/kernel/bpf/task_iter.c
@@ -99,7 +99,6 @@ static int __task_seq_show(struct seq_file *seq, struct task_struct *task,
 	if (!prog)
 		return 0;
 
-	meta.seq = seq;
 	ctx.meta = &meta;
 	ctx.task = task;
 	return bpf_iter_run_prog(prog, &ctx);
-- 
2.35.1
Re: [PATCH bpf-next] bpf: Remove redundant assignment to meta.seq in __task_seq_show()
Posted by Song Liu 4 years, 2 months ago
On Sat, Apr 9, 2022 at 11:00 PM Yuntao Wang <ytcoode@gmail.com> wrote:
>
> The seq argument is assigned to meta.seq twice, the second one is
> redundant, remove it.
>
> This patch also removes a redundant space in bpf_iter_link_attach().
>
> Signed-off-by: Yuntao Wang <ytcoode@gmail.com>

Acked-by: Song Liu <songliubraving@fb.com>
Re: [PATCH bpf-next] bpf: Remove redundant assignment to meta.seq in __task_seq_show()
Posted by patchwork-bot+netdevbpf@kernel.org 4 years, 2 months ago
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Sun, 10 Apr 2022 14:00:19 +0800 you wrote:
> The seq argument is assigned to meta.seq twice, the second one is
> redundant, remove it.
> 
> This patch also removes a redundant space in bpf_iter_link_attach().
> 
> Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: Remove redundant assignment to meta.seq in __task_seq_show()
    https://git.kernel.org/bpf/bpf-next/c/aa1b02e674fe

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html