lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] pwm: Add missing '\n' in log messages
From
Date
On Tue, 2020-04-14 at 20:30 +0200, Christophe JAILLET wrote:
> Being able to detect early missing trailing '\n' would help maintainers
> and patch providers.
>
> You are the 2nd person (I've added Paul Cercueil in copy of my reply)
> who reports that he is thinking that it is no more required to add a '\n'.

The printk subsystem will, for every printk, check
if the last printk has a newline termination and if
it doesn't and the current printk does not start with
KERN_CONT will insert a newline.

The negative to this approach is the last printk,
if it does not have a newline, is buffered and not
emitted until another printk occurs.

There is also the (now small) possibility that
multiple concurrent kernel threads or processes
could interleave printks without a terminating
newline and a different process could emit a
printk that starts with KERN_CONT and the emitted
message could be garbled.

See:

commit 4bcc595ccd80decb4245096e3d1258989c50ed41
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat Oct 8 20:32:40 2016 -0700

printk: reinstate KERN_CONT for printing continuation lines




\
 
 \ /
  Last update: 2020-04-14 21:45    [W:0.212 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site