aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-10-13 18:51:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:12 -0400
commit2240a31db67582468e2f7a5a5962b7d0ffaaa6a4 (patch)
tree5a061c2ca769ba610df8471b08ee4d6b7f0cf02f /kernel/printk
parentde9e14eebf33a60712a52a0bc6e08c043c0aba53 (diff)
printk: don't bother using LOG_CPU_MAX_BUF_SHIFT on !SMP
When configuring a uniprocessor kernel, don't bother the user with an irrelevant LOG_CPU_MAX_BUF_SHIFT question, and don't build the unused code. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 7a6e69441f75..a4436b0cf769 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -267,7 +267,6 @@ static u32 clear_idx;
267#define LOG_ALIGN __alignof__(struct printk_log) 267#define LOG_ALIGN __alignof__(struct printk_log)
268#endif 268#endif
269#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) 269#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
270#define __LOG_CPU_MAX_BUF_LEN (1 << CONFIG_LOG_CPU_MAX_BUF_SHIFT)
271static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); 270static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN);
272static char *log_buf = __log_buf; 271static char *log_buf = __log_buf;
273static u32 log_buf_len = __LOG_BUF_LEN; 272static u32 log_buf_len = __LOG_BUF_LEN;
@@ -852,6 +851,9 @@ static int __init log_buf_len_setup(char *str)
852} 851}
853early_param("log_buf_len", log_buf_len_setup); 852early_param("log_buf_len", log_buf_len_setup);
854 853
854#ifdef CONFIG_SMP
855#define __LOG_CPU_MAX_BUF_LEN (1 << CONFIG_LOG_CPU_MAX_BUF_SHIFT)
856
855static void __init log_buf_add_cpu(void) 857static void __init log_buf_add_cpu(void)
856{ 858{
857 unsigned int cpu_extra; 859 unsigned int cpu_extra;
@@ -878,6 +880,9 @@ static void __init log_buf_add_cpu(void)
878 880
879 log_buf_len_update(cpu_extra + __LOG_BUF_LEN); 881 log_buf_len_update(cpu_extra + __LOG_BUF_LEN);
880} 882}
883#else /* !CONFIG_SMP */
884static inline void log_buf_add_cpu(void) {}
885#endif /* CONFIG_SMP */
881 886
882void __init setup_log_buf(int early) 887void __init setup_log_buf(int early)
883{ 888{