History

uml: more __init annotations

2.6.23-rc1 turned up another batch of references from non-__init code to __init code. In most cases, these were missing __init annotations. In one case (os_drop_memory), the annotation was present but wrong. init_maps is __init, but for some reason was being very careful about the mechanism by which it allocated memory, checking whether it was OK to use kmalloc (at this point in the boot, it definitely isn't) and using either alloc_bootmem_low_pages or kmalloc/vmalloc. So, the kmalloc/vmalloc code is removed.

Jeff Dike committed 19 years ago

Commit 97a1fcb1 parent da3e30e6 files · +12 −17Browse files

Unified · Split

6 files
  1. arch/um/drivers/mconsole_kern.c +2 −2
  2. arch/um/drivers/net_kern.c +1 −1
  3. arch/um/kernel/mem.c +1 −1
  4. arch/um/kernel/physmem.c +5 −10
  5. arch/um/kernel/skas/process.c +2 −2
  6. arch/um/os-Linux/process.c +1 −1
arch/um/drivers/mconsole_kern.c+2−2
@@ -499,7 +499,7 @@ static struct mc_device mem_mc = { · 498 unmodified lines
499499 .remove = mem_remove,
500500 };
501501
502−static int mem_mc_init(void)
502+static int __init mem_mc_init(void)
503503 {
504504 if(can_drop_memory())
505505 mconsole_register_dev(&mem_mc);
@@ -798,7 +798,7 @@ void mconsole_stack(struct mc_request *req) · 292 unmodified lines
798798 */
799799 static char *notify_socket = NULL;
800800
801−static int mconsole_init(void)
801+static int __init mconsole_init(void)
802802 {
803803 /* long to avoid size mismatch warnings from gcc */
804804 long sock;
arch/um/drivers/net_kern.c+1−1
@@ -623,7 +623,7 @@ static int eth_setup_common(char *str, int index) · 622 unmodified lines
623623 return found;
624624 }
625625
626−static int eth_setup(char *str)
626+static int __init eth_setup(char *str)
627627 {
628628 struct eth_init *new;
629629 char *error;
arch/um/kernel/mem.c+1−1
@@ -62,7 +62,7 @@ static void setup_highmem(unsigned long highmem_start, · 61 unmodified lines
6262 }
6363 #endif
6464
65−void mem_init(void)
65+void __init mem_init(void)
6666 {
6767 /* clear the zero-page */
6868 memset((void *) empty_zero_page, 0, PAGE_SIZE);
arch/um/kernel/physmem.c+5−10
@@ -28,7 +28,8 @@ unsigned long high_physmem; · 27 unmodified lines
2828
2929 extern unsigned long long physmem_size;
3030
31−int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
31+int __init init_maps(unsigned long physmem, unsigned long iomem,
32+ unsigned long highmem)
3233 {
3334 struct page *p, *map;
3435 unsigned long phys_len, phys_pages, highmem_len, highmem_pages;
@@ -47,13 +48,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) · 12 unmodified lines
4748 total_pages = phys_pages + iomem_pages + highmem_pages;
4849 total_len = phys_len + iomem_len + highmem_len;
4950
50− if(kmalloc_ok){
51− map = kmalloc(total_len, GFP_KERNEL);
52− if(map == NULL)
53− map = vmalloc(total_len);
54− }
55− else map = alloc_bootmem_low_pages(total_len);
56−
51+ map = alloc_bootmem_low_pages(total_len);
5752 if(map == NULL)
5853 return -ENOMEM;
5954
@@ -98,8 +93,8 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len, · 38 unmodified lines
9893
9994 extern int __syscall_stub_start;
10095
101−void setup_physmem(unsigned long start, unsigned long reserve_end,
102− unsigned long len, unsigned long long highmem)
96+void __init setup_physmem(unsigned long start, unsigned long reserve_end,
97+ unsigned long len, unsigned long long highmem)
10398 {
10499 unsigned long reserve = reserve_end - start;
105100 int pfn = PFN_UP(__pa(reserve_end));
arch/um/kernel/skas/process.c+2−2
@@ -145,7 +145,7 @@ void init_idle_skas(void) · 144 unmodified lines
145145
146146 extern void start_kernel(void);
147147
148−static int start_kernel_proc(void *unused)
148+static int __init start_kernel_proc(void *unused)
149149 {
150150 int pid;
151151
@@ -165,7 +165,7 @@ extern int userspace_pid[]; · 13 unmodified lines
165165
166166 extern char cpu0_irqstack[];
167167
168−int start_uml_skas(void)
168+int __init start_uml_skas(void)
169169 {
170170 stack_protections((unsigned long) &cpu0_irqstack);
171171 set_sigstack(cpu0_irqstack, THREAD_SIZE);
arch/um/os-Linux/process.c+1−1
@@ -194,7 +194,7 @@ int os_unmap_memory(void *addr, int len) · 193 unmodified lines
194194 #define MADV_REMOVE KERNEL_MADV_REMOVE
195195 #endif
196196
197−int __init os_drop_memory(void *addr, int length)
197+int os_drop_memory(void *addr, int length)
198198 {
199199 int err;
200200