aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@sw.ru>2007-07-16 02:39:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:42 -0400
commit708f4b522371da5e6c615a49e1844195aff84cb4 (patch)
treec87006648a17d68428e190c44133c6819972b9ad /kernel/module.c
parent46c65b71e6122b89cd7b2bb36c1ba26d07e84fcd (diff)
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/module.c')
-rw-r--r--kernel/module.c17
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)
2232/* Called by the /proc file system to return a list of modules. */ 2232/* Called by the /proc file system to return a list of modules. */
2233static void *m_start(struct seq_file *m, loff_t *pos) 2233static void *m_start(struct seq_file *m, loff_t *pos)
2234{ 2234{
2235 struct list_head *i;
2236 loff_t n = 0;
2237
2238 mutex_lock(&module_mutex); 2235 mutex_lock(&module_mutex);
2239 list_for_each(i, &modules) { 2236 return seq_list_start(&modules, *pos);
2240 if (n++ == *pos)
2241 break;
2242 }
2243 if (i == &modules)
2244 return NULL;
2245 return i;
2246} 2237}
2247 2238
2248static void *m_next(struct seq_file *m, void *p, loff_t *pos) 2239static void *m_next(struct seq_file *m, void *p, loff_t *pos)
2249{ 2240{
2250 struct list_head *i = p; 2241 return seq_list_next(p, &modules, pos);
2251 (*pos)++;
2252 if (i->next == &modules)
2253 return NULL;
2254 return i->next;
2255} 2242}
2256 2243
2257static void m_stop(struct seq_file *m, void *p) 2244static void m_stop(struct seq_file *m, void *p)