Commit 81c1ebfc authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller

neigh: simplify seq_file code

Simpily pass 'struct neigh_table' with seq_file private pointer,
and save one dereference. Proc entry itself isn't interesting.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a271623f
...@@ -2417,8 +2417,7 @@ EXPORT_SYMBOL(neigh_seq_stop); ...@@ -2417,8 +2417,7 @@ EXPORT_SYMBOL(neigh_seq_stop);
static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos)
{ {
struct proc_dir_entry *pde = seq->private; struct neigh_table *tbl = seq->private;
struct neigh_table *tbl = pde->data;
int cpu; int cpu;
if (*pos == 0) if (*pos == 0)
...@@ -2435,8 +2434,7 @@ static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -2435,8 +2434,7 @@ static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos)
static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ {
struct proc_dir_entry *pde = seq->private; struct neigh_table *tbl = seq->private;
struct neigh_table *tbl = pde->data;
int cpu; int cpu;
for (cpu = *pos; cpu < nr_cpu_ids; ++cpu) { for (cpu = *pos; cpu < nr_cpu_ids; ++cpu) {
...@@ -2455,8 +2453,7 @@ static void neigh_stat_seq_stop(struct seq_file *seq, void *v) ...@@ -2455,8 +2453,7 @@ static void neigh_stat_seq_stop(struct seq_file *seq, void *v)
static int neigh_stat_seq_show(struct seq_file *seq, void *v) static int neigh_stat_seq_show(struct seq_file *seq, void *v)
{ {
struct proc_dir_entry *pde = seq->private; struct neigh_table *tbl = seq->private;
struct neigh_table *tbl = pde->data;
struct neigh_statistics *st = v; struct neigh_statistics *st = v;
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
...@@ -2501,7 +2498,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file) ...@@ -2501,7 +2498,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file)
if (!ret) { if (!ret) {
struct seq_file *sf = file->private_data; struct seq_file *sf = file->private_data;
sf->private = PDE(inode); sf->private = PDE(inode)->data;
} }
return ret; return ret;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment