aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/um/include/os.h2
-rw-r--r--arch/um/include/user_util.h2
-rw-r--r--arch/um/kernel/um_arch.c6
-rw-r--r--arch/um/os-Linux/util.c8
4 files changed, 9 insertions, 9 deletions
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 5c74da41045..22666b4a8be 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -273,7 +273,7 @@ extern void stack_protections(unsigned long address);
extern void task_protections(unsigned long address);
extern int raw(int fd);
extern void setup_machinename(char *machine_out);
-extern void setup_hostinfo(void);
+extern void setup_hostinfo(char *buf, int len);
extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
/* time.c */
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index 99492d5c82d..73ffea1829f 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -36,8 +36,6 @@ extern unsigned long end_vm;
extern unsigned long start_vm;
extern unsigned long long highmem;
-extern char host_info[];
-
extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
extern unsigned long _unprotected_end;
extern unsigned long brk_start;
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 299d75a41a7..613fb082bbd 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -17,6 +17,7 @@
#include "linux/seq_file.h"
#include "linux/delay.h"
#include "linux/module.h"
+#include "linux/utsname.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include "asm/ptrace.h"
@@ -67,6 +68,9 @@ unsigned long thread_saved_pc(struct task_struct *task)
task));
}
+/* Changed in setup_arch, which is called in early boot */
+static char host_info[(__NEW_UTS_LEN + 1) * 5];
+
static int show_cpuinfo(struct seq_file *m, void *v)
{
int index = 0;
@@ -482,7 +486,7 @@ void __init setup_arch(char **cmdline_p)
paging_init();
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
*cmdline_p = command_line;
- setup_hostinfo();
+ setup_hostinfo(host_info, sizeof host_info);
}
void __init check_bugs(void)
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index 56b8a50e8bc..125854a2aa2 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -96,15 +96,13 @@ void setup_machinename(char *machine_out)
strcpy(machine_out, host.machine);
}
-char host_info[(_UTSNAME_LENGTH + 1) * 4 + _UTSNAME_NODENAME_LENGTH + 1];
-
-void setup_hostinfo(void)
+void setup_hostinfo(char *buf, int len)
{
struct utsname host;
uname(&host);
- sprintf(host_info, "%s %s %s %s %s", host.sysname, host.nodename,
- host.release, host.version, host.machine);
+ snprintf(buf, len, "%s %s %s %s %s", host.sysname, host.nodename,
+ host.release, host.version, host.machine);
}
int setjmp_wrapper(void (*proc)(void *, void *), ...)