提交 9af97186 编写于 作者: P Pavel Emelianov 提交者: David S. Miller

[ATM] br2684: Use seq_list_xxx helpers

The .show callback receives the list_head pointer now, not the struct
br2684_dev one.
Signed-off-by: NPavel Emelianov <xemul@openvz.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1c8c7d64
...@@ -699,28 +699,13 @@ static struct atm_ioctl br2684_ioctl_ops = { ...@@ -699,28 +699,13 @@ static struct atm_ioctl br2684_ioctl_ops = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static void *br2684_seq_start(struct seq_file *seq, loff_t *pos) static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
{ {
loff_t offs = 0;
struct br2684_dev *brd;
read_lock(&devs_lock); read_lock(&devs_lock);
return seq_list_start(&br2684_devs, *pos);
list_for_each_entry(brd, &br2684_devs, br2684_devs) {
if (offs == *pos)
return brd;
++offs;
}
return NULL;
} }
static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ {
struct br2684_dev *brd = v; return seq_list_next(v, &br2684_devs, pos);
++*pos;
brd = list_entry(brd->br2684_devs.next,
struct br2684_dev, br2684_devs);
return (&brd->br2684_devs != &br2684_devs) ? brd : NULL;
} }
static void br2684_seq_stop(struct seq_file *seq, void *v) static void br2684_seq_stop(struct seq_file *seq, void *v)
...@@ -730,7 +715,8 @@ static void br2684_seq_stop(struct seq_file *seq, void *v) ...@@ -730,7 +715,8 @@ static void br2684_seq_stop(struct seq_file *seq, void *v)
static int br2684_seq_show(struct seq_file *seq, void *v) static int br2684_seq_show(struct seq_file *seq, void *v)
{ {
const struct br2684_dev *brdev = v; const struct br2684_dev *brdev = list_entry(v, struct br2684_dev,
br2684_devs);
const struct net_device *net_dev = brdev->net_dev; const struct net_device *net_dev = brdev->net_dev;
const struct br2684_vcc *brvcc; const struct br2684_vcc *brvcc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册