From: Joe Perches <joe@perches.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Thierry Reding <thierry.reding@gmail.com>,
paul@crapouillou.net, Dan Carpenter <dan.carpenter@oracle.com>
Cc: u.kleine-koenig@pengutronix.de, linux-pwm@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] pwm: Add missing '\n' in log messages
Date: Tue, 14 Apr 2020 12:04:32 -0700 [thread overview]
Message-ID: <b867ee8a02043ec6b18c9330bfe3a091d66c816c.camel@perches.com> (raw)
In-Reply-To: <f13a8754-3866-d3d2-eaff-29cb6d14ff8d@wanadoo.fr>
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
prev parent reply other threads:[~2020-04-14 19:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-11 15:35 [PATCH] pwm: Add missing '\n' in log messages Christophe JAILLET
2020-04-11 16:37 ` Uwe Kleine-König
2020-04-14 13:58 ` Thierry Reding
2020-04-14 18:30 ` Christophe JAILLET
2020-04-14 18:49 ` Dan Carpenter
2020-04-14 19:09 ` Joe Perches
2020-04-14 19:04 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b867ee8a02043ec6b18c9330bfe3a091d66c816c.camel@perches.com \
--to=joe@perches.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox