bpf: Remove redundant assignment to meta.seq in __task_seq_show()
authorYuntao Wang <ytcoode@gmail.com>
Sun, 10 Apr 2022 06:00:19 +0000 (14:00 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 11 Apr 2022 19:14:34 +0000 (21:14 +0200)
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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20220410060020.307283-1-ytcoode@gmail.com
kernel/bpf/bpf_iter.c
kernel/bpf/task_iter.c

index dea920b3b8403c27099aeb8f50c01f302fe49957..d5d96ceca10584e86c94f5b264cde5766b47da34 100644 (file)
@@ -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;
index d94696198ef89b54ec41231ae2dc2254898c9c2f..8c921799def4927dd09d2a799d05c9d4b87fba46 100644 (file)
@@ -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);