Skip to contentSkip to conversation

bpf: Remove redundant assignment to meta.seq in __task_seq_show()

PATCH Applied Yuntao Wang 3 participants 3 messages Apr 10, 2022 – Apr 11, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Remove redundant assignment to meta.seq in __task_seq_show()

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().

---
 kernel/bpf/bpf_iter.c  | 2 +-
 kernel/bpf/task_iter.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
kernel/bpf/bpf_iter.c +1 -1
index dea920b3b840..d5d96ceca105 100644
@@ -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;
kernel/bpf/task_iter.c +0 -1
index d94696198ef8..8c921799def4 100644
@@ -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);
Signature · 1 line
2.35.1
#2 lore raw
In reply to Yuntao Wang
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 8 lines · 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().

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html