Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25216b00395dfb52bfe06e4886a6ad831ede7b4b
Commit:     25216b00395dfb52bfe06e4886a6ad831ede7b4b
Parent:     708f4b522371da5e6c615a49e1844195aff84cb4
Author:     Pavel Emelianov <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 15 23:39:54 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 09:05:42 2007 -0700

    Make /proc/tty/drivers use seq_list_xxx helpers
    
    Simple and stupid like some previous ones.  Just use new API.
    
    Signed-off-by: Pavel Emelianov <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/proc/proc_tty.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index b3a473b..2284622 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -69,7 +69,7 @@ static void show_tty_range(struct seq_file *m, struct 
tty_driver *p,
 
 static int show_tty_driver(struct seq_file *m, void *v)
 {
-       struct tty_driver *p = v;
+       struct tty_driver *p = list_entry(v, struct tty_driver, tty_drivers);
        dev_t from = MKDEV(p->major, p->minor_start);
        dev_t to = from + p->num;
 
@@ -106,22 +106,13 @@ static int show_tty_driver(struct seq_file *m, void *v)
 /* iterator */
 static void *t_start(struct seq_file *m, loff_t *pos)
 {
-       struct list_head *p;
-       loff_t l = *pos;
-
        mutex_lock(&tty_mutex);
-       list_for_each(p, &tty_drivers)
-               if (!l--)
-                       return list_entry(p, struct tty_driver, tty_drivers);
-       return NULL;
+       return seq_list_start(&tty_drivers, *pos);
 }
 
 static void *t_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       struct list_head *p = ((struct tty_driver *)v)->tty_drivers.next;
-       (*pos)++;
-       return p==&tty_drivers ? NULL :
-                       list_entry(p, struct tty_driver, tty_drivers);
+       return seq_list_next(v, &tty_drivers, pos);
 }
 
 static void t_stop(struct seq_file *m, void *v)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to