diff options
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r-- | kernel/printk/printk.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index be7c86bae576..4dae9cbe9259 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
@@ -757,14 +757,10 @@ void __init setup_log_buf(int early) | |||
757 | return; | 757 | return; |
758 | 758 | ||
759 | if (early) { | 759 | if (early) { |
760 | unsigned long mem; | 760 | new_log_buf = |
761 | 761 | memblock_virt_alloc(new_log_buf_len, PAGE_SIZE); | |
762 | mem = memblock_alloc(new_log_buf_len, PAGE_SIZE); | ||
763 | if (!mem) | ||
764 | return; | ||
765 | new_log_buf = __va(mem); | ||
766 | } else { | 762 | } else { |
767 | new_log_buf = alloc_bootmem_nopanic(new_log_buf_len); | 763 | new_log_buf = memblock_virt_alloc_nopanic(new_log_buf_len, 0); |
768 | } | 764 | } |
769 | 765 | ||
770 | if (unlikely(!new_log_buf)) { | 766 | if (unlikely(!new_log_buf)) { |
@@ -1080,7 +1076,6 @@ static int syslog_print_all(char __user *buf, int size, bool clear) | |||
1080 | next_seq = log_next_seq; | 1076 | next_seq = log_next_seq; |
1081 | 1077 | ||
1082 | len = 0; | 1078 | len = 0; |
1083 | prev = 0; | ||
1084 | while (len >= 0 && seq < next_seq) { | 1079 | while (len >= 0 && seq < next_seq) { |
1085 | struct printk_log *msg = log_from_idx(idx); | 1080 | struct printk_log *msg = log_from_idx(idx); |
1086 | int textlen; | 1081 | int textlen; |
@@ -1599,10 +1594,13 @@ asmlinkage int vprintk_emit(int facility, int level, | |||
1599 | * either merge it with the current buffer and flush, or if | 1594 | * either merge it with the current buffer and flush, or if |
1600 | * there was a race with interrupts (prefix == true) then just | 1595 | * there was a race with interrupts (prefix == true) then just |
1601 | * flush it out and store this line separately. | 1596 | * flush it out and store this line separately. |
1597 | * If the preceding printk was from a different task and missed | ||
1598 | * a newline, flush and append the newline. | ||
1602 | */ | 1599 | */ |
1603 | if (cont.len && cont.owner == current) { | 1600 | if (cont.len) { |
1604 | if (!(lflags & LOG_PREFIX)) | 1601 | if (cont.owner == current && !(lflags & LOG_PREFIX)) |
1605 | stored = cont_add(facility, level, text, text_len); | 1602 | stored = cont_add(facility, level, text, |
1603 | text_len); | ||
1606 | cont_flush(LOG_NEWLINE); | 1604 | cont_flush(LOG_NEWLINE); |
1607 | } | 1605 | } |
1608 | 1606 | ||
@@ -2789,7 +2787,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
2789 | next_idx = idx; | 2787 | next_idx = idx; |
2790 | 2788 | ||
2791 | l = 0; | 2789 | l = 0; |
2792 | prev = 0; | ||
2793 | while (seq < dumper->next_seq) { | 2790 | while (seq < dumper->next_seq) { |
2794 | struct printk_log *msg = log_from_idx(idx); | 2791 | struct printk_log *msg = log_from_idx(idx); |
2795 | 2792 | ||