mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-kernel@vger.kernel.org
Cc: rostedt@goodmis.org, pantelis.antoniou@konsulko.com,
	mark.rutland@arm.com, pmladek@suse.com,
	andriy.shevchenko@linux.intel.com, joe@perches.com,
	corbet@lwn.net, me@tobin.cc, sergey.senozhatsky@gmail.com,
	Richard Weinberger <richard@nod.at>
Subject: [PATCH 2/2] printk: Use %pCOW for kmsg
Date: Sun,  1 Apr 2018 10:56:22 +0200	[thread overview]
Message-ID: <20180401085622.7754-3-richard@nod.at> (raw)
In-Reply-To: <20180401085622.7754-1-richard@nod.at>

...userspace likes eye candy.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 kernel/printk/printk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f274fbef821d..42ea0a18081d 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -815,7 +815,10 @@ static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)
 		}
 	}
 
-	printk_emit(facility, level, NULL, 0, "%s", line);
+	if (line[len - 1] == '\n')
+		line[len - 1] = '\0';
+
+	printk_emit(facility, level, NULL, 0, "%pCOW", line);
 	kfree(buf);
 	return ret;
 }
-- 
2.13.6

  parent reply	other threads:[~2018-04-01  8:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-01  8:56 [PATCH 0/2] cowsay support Richard Weinberger
2018-04-01  8:56 ` [PATCH 1/2] lib: vsprintf: Implement %pCOW Richard Weinberger
2018-04-01  9:15   ` Adam Borowski
2018-04-01  9:18     ` Richard Weinberger
2018-04-02 14:18   ` Andy Shevchenko
2018-04-03  9:15     ` Petr Mladek
2018-04-01  8:56 ` Richard Weinberger [this message]
2018-04-02  1:57 ` [PATCH 0/2] cowsay support Sergey Senozhatsky

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=20180401085622.7754-3-richard@nod.at \
    --to=richard@nod.at \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=me@tobin.cc \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    /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

all inboxes | Powered by JetHome®