Commit 9c8d6381dc107dbc2bfdbfdcaefe0d42e5b5b362

Authored by Jeff Dike
Committed by Linus Torvalds
1 parent 32f862c310

uml: fix build for !CONFIG_PRINTK

Handle the case of CONFIG_PRINTK being disabled.  This requires a do-nothing
stub to be present in arch/um/include/user.h so that we don't get references
to printk from libc code.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff

arch/um/include/user.h
1 1 /*
2   - * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
  2 + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 3 * Licensed under the GPL
4 4 */
5 5  
6 6 #ifndef __USER_H__
7 7 #define __USER_H__
8 8  
  9 +#include "uml-config.h"
  10 +
9 11 /*
10 12 * The usual definition - copied here because the kernel provides its own,
11 13 * fancier, type-safe, definition. Using that one would require
12 14  
... ... @@ -23,8 +25,17 @@
23 25  
24 26 extern void panic(const char *fmt, ...)
25 27 __attribute__ ((format (printf, 1, 2)));
  28 +
  29 +#ifdef UML_CONFIG_PRINTK
26 30 extern int printk(const char *fmt, ...)
27 31 __attribute__ ((format (printf, 1, 2)));
  32 +#else
  33 +static inline int printk(const char *fmt, ...)
  34 +{
  35 + return 0;
  36 +}
  37 +#endif
  38 +
28 39 extern void schedule(void);
29 40 extern int in_aton(char *str);
30 41 extern int open_gdb_chan(void);