summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2014-01-10 12:41:40 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2014-01-10 12:41:40 +1100
commitb2c7a9d609dd79d65f2ff596ba9eff01ccb6bb62 (patch)
treee3806697bff6bc731ab44d7db58fca2fce4670fe /kernel
parente79248907e79dbec386bcaaf995d034abd834c79 (diff)
printk-flush-conflicting-continuation-line-fix
simplify and condense the code Cc: Joe Perches <joe@perches.com> Cc: Tejun Heo <tj@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Arun KS <arun.ks@broadcom.com> Cc: Arun KS <arunks.linux@gmail.com> Cc: Arun KS <getarunks@gmail.com> Cc: Kay Sievers <kay@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/printk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 6378e07ab81c..b1d255f04135 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1595,15 +1595,15 @@ asmlinkage int vprintk_emit(int facility, int level,
* either merge it with the current buffer and flush, or if
* there was a race with interrupts (prefix == true) then just
* flush it out and store this line separately.
+ * If the preceding printk was from a different task and missed
+ * a newline, flush and append the newline.
*/
- if (cont.len && cont.owner == current) {
- if (!(lflags & LOG_PREFIX))
- stored = cont_add(facility, level, text, text_len);
- cont_flush(LOG_NEWLINE);
- /* Flush conflicting buffer. An earlier newline was missing
- * and current print is from different task */
- } else if (cont.len && cont.owner != current)
+ if (cont.len) {
+ if (cont.owner == current && !(lflags & LOG_PREFIX))
+ stored = cont_add(facility, level, text,
+ text_len);
cont_flush(LOG_NEWLINE);
+ }
if (!stored)
log_store(facility, level, lflags, 0,