summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo2009-02-20 08:29:07 +0100
committerTejun Heo2009-02-20 08:29:07 +0100
commit6b588c18f8dacfa6d7957c33c5ff832096e752d3 (patch)
treec59c2f1719ce9d4bc23e85b4f205772a61944530 /kernel
parentvmalloc: call flush_cache_vunmap() from unmap_kernel_range() (diff)
downloadkernel-qcow2-linux-6b588c18f8dacfa6d7957c33c5ff832096e752d3.tar.gz
kernel-qcow2-linux-6b588c18f8dacfa6d7957c33c5ff832096e752d3.tar.xz
kernel-qcow2-linux-6b588c18f8dacfa6d7957c33c5ff832096e752d3.zip
module: reorder module pcpu related functions
Impact: cleanup Move percpu_modinit() upwards. This is to ease further changes. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/kernel/module.c b/kernel/module.c
index ba22484a987e..52b3497b8748 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -480,21 +480,6 @@ static void percpu_modfree(void *freeme)
}
}
-static unsigned int find_pcpusec(Elf_Ehdr *hdr,
- Elf_Shdr *sechdrs,
- const char *secstrings)
-{
- return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
-}
-
-static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
-{
- int cpu;
-
- for_each_possible_cpu(cpu)
- memcpy(pcpudest + per_cpu_offset(cpu), from, size);
-}
-
static int percpu_modinit(void)
{
pcpu_num_used = 2;
@@ -513,7 +498,24 @@ static int percpu_modinit(void)
return 0;
}
__initcall(percpu_modinit);
+
+static unsigned int find_pcpusec(Elf_Ehdr *hdr,
+ Elf_Shdr *sechdrs,
+ const char *secstrings)
+{
+ return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
+}
+
+static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
+{
+ int cpu;
+
+ for_each_possible_cpu(cpu)
+ memcpy(pcpudest + per_cpu_offset(cpu), from, size);
+}
+
#else /* ... !CONFIG_SMP */
+
static inline void *percpu_modalloc(unsigned long size, unsigned long align,
const char *name)
{
@@ -535,6 +537,7 @@ static inline void percpu_modcopy(void *pcpudst, const void *src,
/* pcpusec should be 0, and size of that section should be 0. */
BUG_ON(size != 0);
}
+
#endif /* CONFIG_SMP */
#define MODINFO_ATTR(field) \