Thread (30 messages) 30 messages, 8 authors, 2021-06-12

Re: [PATCH v2 15/15] x86: convert to setup_initial_init_mm()

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2021-06-08 00:26:23
Also in: lkml

On Fri, 4 Jun 2021 15:06:33 +0800 Kefeng Wang [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Use setup_initial_init_mm() helper to simplify code.

...
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -868,10 +868,7 @@ void __init setup_arch(char **cmdline_p)
 
 	if (!boot_params.hdr.root_flags)
 		root_mountflags &= ~MS_RDONLY;
-	init_mm.start_code = (unsigned long) _text;
-	init_mm.end_code = (unsigned long) _etext;
-	init_mm.end_data = (unsigned long) _edata;
-	init_mm.brk = _brk_end;
+	setup_initial_init_mm(_text, _etext, _edata, _brk_end);
 
 	code_resource.start = __pa_symbol(_text);
 	code_resource.end = __pa_symbol(_etext)-1;
arch/x86/kernel/setup.c:873:47: warning: passing argument 4 of 'setup_initial_init_mm' makes pointer from integer without a cast [-Wint-conversion]
  873 |  setup_initial_init_mm(_text, _etext, _edata, _brk_end);
      |                                               ^~~~~~~~
      |                                               |
      |                                               long unsigned int
In file included from ./include/linux/pid_namespace.h:7,
                 from ./include/linux/ptrace.h:10,
                 from ./include/linux/elfcore.h:11,
                 from ./include/linux/crash_core.h:6,
                 from ./include/linux/kexec.h:18,
                 from ./include/linux/crash_dump.h:5,
                 from arch/x86/kernel/setup.c:9:
./include/linux/mm.h:248:29: note: expected 'void *' but argument is of type 'long unsigned int'
  248 |       void *end_data, void *brk);
      |                       ~~~~~~^~~


afaict the other architectures will warn this way, not sure.

Please check all that, refresh ,retest and resend?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help