From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT
Date: Thu, 13 Oct 2016 23:59:52 +0200 [thread overview]
Message-ID: <2154245.64ushtJ5yk@vostro.rjw.lan> (raw)
In-Reply-To: <2344de692f658b8bb07ba53702286b43911e4753.1476298191.git.joe@perches.com>
On Wednesday, October 12, 2016 11:50:34 AM Joe Perches wrote:
> acpi_os_vprintf currently always uses a KERN_CONT prefix which may be
> followed immediately by a proper KERN_<LEVEL>. Check if the buffer
> already has a KERN_<LEVEL> at the start of the buffer and avoid the
> unnecessary KERN_CONT.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/acpi/osl.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> index 4305ee9db4b2..416953a42510 100644
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -162,11 +162,18 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> if (acpi_in_debugger) {
> kdb_printf("%s", buffer);
> } else {
> - printk(KERN_CONT "%s", buffer);
> + if (printk_get_level(buffer))
> + printk("%s", buffer);
> + else
> + printk(KERN_CONT "%s", buffer);
> }
> #else
> - if (acpi_debugger_write_log(buffer) < 0)
> - printk(KERN_CONT "%s", buffer);
> + if (acpi_debugger_write_log(buffer) < 0) {
> + if (printk_get_level(buffer))
> + printk("%s", buffer);
> + else
> + printk(KERN_CONT "%s", buffer);
> + }
> #endif
> }
Applied.
Thanks,
Rafael
next prev parent reply other threads:[~2016-10-13 22:00 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 13:30 linux.git: printk() problem Tetsuo Handa
2016-10-12 14:35 ` Michal Hocko
2016-10-12 16:08 ` Joe Perches
2016-10-13 6:26 ` Michal Hocko
2016-10-13 9:29 ` Joe Perches
2016-10-13 10:04 ` Michal Hocko
2016-10-13 10:20 ` Joe Perches
2016-10-13 11:06 ` Michal Hocko
2016-10-12 15:47 ` Linus Torvalds
2016-10-12 16:16 ` Joe Perches
2016-10-12 16:54 ` Linus Torvalds
2016-10-12 18:50 ` [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT Joe Perches
2016-10-13 21:59 ` Rafael J. Wysocki [this message]
2016-10-23 9:22 ` linux.git: printk() problem Geert Uytterhoeven
2016-10-23 18:11 ` Linus Torvalds
2016-10-23 19:06 ` Joe Perches
2016-10-23 19:32 ` Linus Torvalds
2016-10-23 19:46 ` Linus Torvalds
2016-10-24 11:15 ` Geert Uytterhoeven
2016-10-24 14:08 ` Sergey Senozhatsky
2016-10-24 14:23 ` Sergey Senozhatsky
2016-10-24 17:54 ` Linus Torvalds
2016-10-24 17:55 ` Linus Torvalds
2016-10-25 1:55 ` Sergey Senozhatsky
2016-10-25 2:06 ` Linus Torvalds
2016-10-25 2:22 ` Linus Torvalds
2016-10-25 4:06 ` Sergey Senozhatsky
2016-10-25 4:13 ` Joe Perches
2016-10-25 4:15 ` Linus Torvalds
2016-10-25 4:44 ` Sergey Senozhatsky
2016-10-25 14:44 ` Petr Mladek
2016-11-09 15:47 ` Petr Mladek
2016-10-25 2:24 ` Sergey Senozhatsky
2016-10-23 20:33 ` Joe Perches
2016-10-23 21:13 ` Linus Torvalds
2016-10-25 14:42 ` Steven Rostedt
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=2154245.64ushtJ5yk@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=joe@perches.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).