diff options
author | Pavel Emelianov <xemul@sw.ru> | 2007-07-15 23:39:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 09:05:42 -0700 |
commit | 708f4b522371da5e6c615a49e1844195aff84cb4 (patch) | |
tree | c87006648a17d68428e190c44133c6819972b9ad /kernel | |
parent | 46c65b71e6122b89cd7b2bb36c1ba26d07e84fcd (diff) | |
download | linux-708f4b522371da5e6c615a49e1844195aff84cb4.tar.bz2 |
Make /proc/modules use seq_list_xxx helpers
Here there is not need even in .show callback altering. The original code
passes list_head in *v.
Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/kernel/module.c b/kernel/module.c index 015d60cfd90e..7a1a4d3558d5 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2232,26 +2232,13 @@ unsigned long module_kallsyms_lookup_name(const char *name) /* Called by the /proc file system to return a list of modules. */ static void *m_start(struct seq_file *m, loff_t *pos) { - struct list_head *i; - loff_t n = 0; - mutex_lock(&module_mutex); - list_for_each(i, &modules) { - if (n++ == *pos) - break; - } - if (i == &modules) - return NULL; - return i; + return seq_list_start(&modules, *pos); } static void *m_next(struct seq_file *m, void *p, loff_t *pos) { - struct list_head *i = p; - (*pos)++; - if (i->next == &modules) - return NULL; - return i->next; + return seq_list_next(p, &modules, pos); } static void m_stop(struct seq_file *m, void *p) |