]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/atm/br2684.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / net / atm / br2684.c
index 0e9f00c5c89942cfccbd5f76afa84e82f7afc4cc..faa6aaf67563ff298121518ffc192655a85be2ab 100644 (file)
@@ -699,28 +699,13 @@ static struct atm_ioctl br2684_ioctl_ops = {
 #ifdef CONFIG_PROC_FS
 static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
 {
-       loff_t offs = 0;
-       struct br2684_dev *brd;
-
        read_lock(&devs_lock);
-
-       list_for_each_entry(brd, &br2684_devs, br2684_devs) {
-               if (offs == *pos)
-                       return brd;
-               ++offs;
-       }
-       return NULL;
+       return seq_list_start(&br2684_devs, *pos);
 }
 
 static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 {
-       struct br2684_dev *brd = v;
-
-       ++*pos;
-
-       brd = list_entry(brd->br2684_devs.next,
-                        struct br2684_dev, br2684_devs);
-       return (&brd->br2684_devs != &br2684_devs) ? brd : NULL;
+       return seq_list_next(v, &br2684_devs, pos);
 }
 
 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)
 {
-       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 br2684_vcc *brvcc;
 
@@ -772,7 +758,7 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations br2684_seq_ops = {
+static const struct seq_operations br2684_seq_ops = {
        .start = br2684_seq_start,
        .next  = br2684_seq_next,
        .stop  = br2684_seq_stop,