diff options
Diffstat (limited to 'kernel/module.c')
-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) | |||
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. */ |
2233 | static void *m_start(struct seq_file *m, loff_t *pos) | 2233 | static 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 | ||
2248 | static void *m_next(struct seq_file *m, void *p, loff_t *pos) | 2239 | static 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 | ||
2257 | static void m_stop(struct seq_file *m, void *p) | 2244 | static void m_stop(struct seq_file *m, void *p) |