diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-01-22 05:16:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-23 04:21:27 -0500 |
commit | 81c1ebfc4379f529b001e23164dd5c2282bdc0ec (patch) | |
tree | ec47506bb12384db0c5beeddf2567f421f18462d /net/core | |
parent | a271623f871dda970319ca15dfad3a8c8c36249f (diff) |
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: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/neighbour.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index f35377b643e4..f2efd72da799 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2417,8 +2417,7 @@ EXPORT_SYMBOL(neigh_seq_stop); | |||
2417 | 2417 | ||
2418 | static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) | 2418 | static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) |
2419 | { | 2419 | { |
2420 | struct proc_dir_entry *pde = seq->private; | 2420 | struct neigh_table *tbl = seq->private; |
2421 | struct neigh_table *tbl = pde->data; | ||
2422 | int cpu; | 2421 | int cpu; |
2423 | 2422 | ||
2424 | if (*pos == 0) | 2423 | if (*pos == 0) |
@@ -2435,8 +2434,7 @@ static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos) | |||
2435 | 2434 | ||
2436 | static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 2435 | static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
2437 | { | 2436 | { |
2438 | struct proc_dir_entry *pde = seq->private; | 2437 | struct neigh_table *tbl = seq->private; |
2439 | struct neigh_table *tbl = pde->data; | ||
2440 | int cpu; | 2438 | int cpu; |
2441 | 2439 | ||
2442 | for (cpu = *pos; cpu < nr_cpu_ids; ++cpu) { | 2440 | 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 | 2453 | ||
2456 | static int neigh_stat_seq_show(struct seq_file *seq, void *v) | 2454 | static int neigh_stat_seq_show(struct seq_file *seq, void *v) |
2457 | { | 2455 | { |
2458 | struct proc_dir_entry *pde = seq->private; | 2456 | struct neigh_table *tbl = seq->private; |
2459 | struct neigh_table *tbl = pde->data; | ||
2460 | struct neigh_statistics *st = v; | 2457 | struct neigh_statistics *st = v; |
2461 | 2458 | ||
2462 | if (v == SEQ_START_TOKEN) { | 2459 | if (v == SEQ_START_TOKEN) { |
@@ -2501,7 +2498,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file) | |||
2501 | 2498 | ||
2502 | if (!ret) { | 2499 | if (!ret) { |
2503 | struct seq_file *sf = file->private_data; | 2500 | struct seq_file *sf = file->private_data; |
2504 | sf->private = PDE(inode); | 2501 | sf->private = PDE(inode)->data; |
2505 | } | 2502 | } |
2506 | return ret; | 2503 | return ret; |
2507 | }; | 2504 | }; |