Skip to content

Commit f5527f0

Browse files
Al ViroAlexei Starovoitov
authored andcommitted
bpf: Get rid of redundant 3rd argument of prepare_seq_file()
Remove 3rd argument in prepare_seq_file() to clean up the code a bit. Signed-off-by: Al Viro <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/r/20250615004719.GE3011112@ZenIV Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 85cd83f commit f5527f0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/bpf/bpf_iter.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ static DEFINE_MUTEX(link_mutex);
3838
/* incremented on every opened seq_file */
3939
static atomic64_t session_id;
4040

41-
static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
42-
const struct bpf_iter_seq_info *seq_info);
41+
static int prepare_seq_file(struct file *file, struct bpf_iter_link *link);
4342

4443
static void bpf_iter_inc_seq_num(struct seq_file *seq)
4544
{
@@ -257,7 +256,7 @@ static int iter_open(struct inode *inode, struct file *file)
257256
{
258257
struct bpf_iter_link *link = inode->i_private;
259258

260-
return prepare_seq_file(file, link, __get_seq_info(link));
259+
return prepare_seq_file(file, link);
261260
}
262261

263262
static int iter_release(struct inode *inode, struct file *file)
@@ -586,9 +585,9 @@ static void init_seq_meta(struct bpf_iter_priv_data *priv_data,
586585
priv_data->done_stop = false;
587586
}
588587

589-
static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
590-
const struct bpf_iter_seq_info *seq_info)
588+
static int prepare_seq_file(struct file *file, struct bpf_iter_link *link)
591589
{
590+
const struct bpf_iter_seq_info *seq_info = __get_seq_info(link);
592591
struct bpf_iter_priv_data *priv_data;
593592
struct bpf_iter_target_info *tinfo;
594593
struct bpf_prog *prog;
@@ -653,7 +652,7 @@ int bpf_iter_new_fd(struct bpf_link *link)
653652
}
654653

655654
iter_link = container_of(link, struct bpf_iter_link, link);
656-
err = prepare_seq_file(file, iter_link, __get_seq_info(iter_link));
655+
err = prepare_seq_file(file, iter_link);
657656
if (err)
658657
goto free_file;
659658

0 commit comments

Comments
 (0)