aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
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)