]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0281-printk-fix-a-build-on-powerpc.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0281-printk-fix-a-build-on-powerpc.patch
1 From ecf242f713e3f6d1431a98869a14701cdadb70d3 Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Thu, 4 Feb 2016 18:56:10 +0100
4 Subject: [PATCH 281/366] printk: fix a build on powerpc
5
6 As pwe kbuild test robot:
7 arch/powerpc/kernel/built-in.o: In function `register_early_udbg_console':
8 >> (.init.text+0x1266): undefined reference to `early_console'
9    arch/powerpc/kernel/built-in.o: In function `register_early_udbg_console':
10    (.init.text+0x126a): undefined reference to `early_console'
11    arch/powerpc/kernel/built-in.o: In function `register_early_udbg_console':
12    (.init.text+0x12d2): undefined reference to `early_console'
13
14 Reported-by: kbuild test robot <fengguang.wu@intel.com>
15 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
16 ---
17  kernel/printk/printk.c | 115 +++++++++++++++++++++++++------------------------
18  1 file changed, 59 insertions(+), 56 deletions(-)
19
20 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
21 index 84400c4..cd377c4 100644
22 --- a/kernel/printk/printk.c
23 +++ b/kernel/printk/printk.c
24 @@ -245,6 +245,65 @@ struct printk_log {
25   */
26  static DEFINE_RAW_SPINLOCK(logbuf_lock);
27  
28 +#ifdef CONFIG_EARLY_PRINTK
29 +struct console *early_console;
30 +
31 +static void early_vprintk(const char *fmt, va_list ap)
32 +{
33 +       if (early_console) {
34 +               char buf[512];
35 +               int n = vscnprintf(buf, sizeof(buf), fmt, ap);
36 +
37 +               early_console->write(early_console, buf, n);
38 +       }
39 +}
40 +
41 +asmlinkage void early_printk(const char *fmt, ...)
42 +{
43 +       va_list ap;
44 +
45 +       va_start(ap, fmt);
46 +       early_vprintk(fmt, ap);
47 +       va_end(ap);
48 +}
49 +
50 +/*
51 + * This is independent of any log levels - a global
52 + * kill switch that turns off all of printk.
53 + *
54 + * Used by the NMI watchdog if early-printk is enabled.
55 + */
56 +static bool __read_mostly printk_killswitch;
57 +
58 +static int __init force_early_printk_setup(char *str)
59 +{
60 +       printk_killswitch = true;
61 +       return 0;
62 +}
63 +early_param("force_early_printk", force_early_printk_setup);
64 +
65 +void printk_kill(void)
66 +{
67 +       printk_killswitch = true;
68 +}
69 +
70 +#ifdef CONFIG_PRINTK
71 +static int forced_early_printk(const char *fmt, va_list ap)
72 +{
73 +       if (!printk_killswitch)
74 +               return 0;
75 +       early_vprintk(fmt, ap);
76 +       return 1;
77 +}
78 +#endif
79 +
80 +#else
81 +static inline int forced_early_printk(const char *fmt, va_list ap)
82 +{
83 +       return 0;
84 +}
85 +#endif
86 +
87  #ifdef CONFIG_PRINTK
88  DECLARE_WAIT_QUEUE_HEAD(log_wait);
89  /* the next printk record to read by syslog(READ) or /proc/kmsg */
90 @@ -1731,62 +1790,6 @@ static size_t cont_print_text(char *text, size_t size)
91         return textlen;
92  }
93  
94 -#ifdef CONFIG_EARLY_PRINTK
95 -struct console *early_console;
96 -
97 -static void early_vprintk(const char *fmt, va_list ap)
98 -{
99 -       if (early_console) {
100 -               char buf[512];
101 -               int n = vscnprintf(buf, sizeof(buf), fmt, ap);
102 -
103 -               early_console->write(early_console, buf, n);
104 -       }
105 -}
106 -
107 -asmlinkage void early_printk(const char *fmt, ...)
108 -{
109 -       va_list ap;
110 -
111 -       va_start(ap, fmt);
112 -       early_vprintk(fmt, ap);
113 -       va_end(ap);
114 -}
115 -
116 -/*
117 - * This is independent of any log levels - a global
118 - * kill switch that turns off all of printk.
119 - *
120 - * Used by the NMI watchdog if early-printk is enabled.
121 - */
122 -static bool __read_mostly printk_killswitch;
123 -
124 -static int __init force_early_printk_setup(char *str)
125 -{
126 -       printk_killswitch = true;
127 -       return 0;
128 -}
129 -early_param("force_early_printk", force_early_printk_setup);
130 -
131 -void printk_kill(void)
132 -{
133 -       printk_killswitch = true;
134 -}
135 -
136 -static int forced_early_printk(const char *fmt, va_list ap)
137 -{
138 -       if (!printk_killswitch)
139 -               return 0;
140 -       early_vprintk(fmt, ap);
141 -       return 1;
142 -}
143 -#else
144 -static inline int forced_early_printk(const char *fmt, va_list ap)
145 -{
146 -       return 0;
147 -}
148 -#endif
149 -
150  asmlinkage int vprintk_emit(int facility, int level,
151                             const char *dict, size_t dictlen,
152                             const char *fmt, va_list args)
153 -- 
154 1.9.1
155