Skip to content

Commit 36e4546

Browse files
cfd-36Linus Torvalds
authored andcommitted
uml: add missing __init declarations
The build started finding calls from non-init to init functions. These are just cases of init functions not being properly marked, so this patch fixes that. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9218b17 commit 36e4546

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎arch/um/kernel/mem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static void __init fixaddr_user_init( void)
216216
#endif
217217
}
218218

219-
void paging_init(void)
219+
void __init paging_init(void)
220220
{
221221
unsigned long zones_size[MAX_NR_ZONES], vaddr;
222222
int i;

‎arch/um/os-Linux/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ extern int uml_exitcode;
120120

121121
extern void scan_elf_aux( char **envp);
122122

123-
int main(int argc, char **argv, char **envp)
123+
int __init main(int argc, char **argv, char **envp)
124124
{
125125
char **new_argv;
126126
int ret, i, err;

‎arch/um/os-Linux/mem.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ static void which_tmpdir(void)
164164
* (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger).
165165
* So it isn't 'static' yet.
166166
*/
167-
int make_tempfile(const char *template, char **out_tempname, int do_unlink)
167+
int __init make_tempfile(const char *template, char **out_tempname,
168+
int do_unlink)
168169
{
169170
char *tempname;
170171
int fd;
@@ -205,7 +206,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink)
205206
* This proc is used in start_up.c
206207
* So it isn't 'static'.
207208
*/
208-
int create_tmp_file(unsigned long long len)
209+
int __init create_tmp_file(unsigned long long len)
209210
{
210211
int fd, err;
211212
char zero;
@@ -241,7 +242,7 @@ int create_tmp_file(unsigned long long len)
241242
return fd;
242243
}
243244

244-
int create_mem_file(unsigned long long len)
245+
int __init create_mem_file(unsigned long long len)
245246
{
246247
int err, fd;
247248

@@ -256,7 +257,7 @@ int create_mem_file(unsigned long long len)
256257
}
257258

258259

259-
void check_tmpexec(void)
260+
void __init check_tmpexec(void)
260261
{
261262
void *addr;
262263
int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE);

‎arch/um/os-Linux/process.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "skas_ptrace.h"
2222
#include "kern_constants.h"
2323
#include "uml-config.h"
24+
#include "init.h"
2425

2526
#define ARBITRARY_ADDR -1
2627
#define FAILURE_PID -1
@@ -192,7 +193,7 @@ int os_unmap_memory(void *addr, int len)
192193
#define MADV_REMOVE KERNEL_MADV_REMOVE
193194
#endif
194195

195-
int os_drop_memory(void *addr, int length)
196+
int __init os_drop_memory(void *addr, int length)
196197
{
197198
int err;
198199

@@ -202,7 +203,7 @@ int os_drop_memory(void *addr, int length)
202203
return err;
203204
}
204205

205-
int can_drop_memory(void)
206+
int __init can_drop_memory(void)
206207
{
207208
void *addr;
208209
int fd, ok = 0;

‎arch/um/os-Linux/start_up.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static void __init check_ptrace(void)
329329

330330
extern void check_tmpexec(void);
331331

332-
static void check_coredump_limit(void)
332+
static void __init check_coredump_limit(void)
333333
{
334334
struct rlimit lim;
335335
int err = getrlimit(RLIMIT_CORE, &lim);
@@ -350,7 +350,7 @@ static void check_coredump_limit(void)
350350
else printf("%lu\n", lim.rlim_max);
351351
}
352352

353-
void os_early_checks(void)
353+
void __init os_early_checks(void)
354354
{
355355
/* Print out the core dump limits early */
356356
check_coredump_limit();

0 commit comments

Comments
 (0)