Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499889

[PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT
Date 2016-10-12 21:00 +0200
Message-ID <srwUV-8js-5@gated-at.bofh.it> (permalink)
References <srv2N-73S-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
 }
 
-- 
2.10.0.rc2.1.g053435c

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

linux.git: printk() problem Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-10-12 15:40 +0200
  Re: linux.git: printk() problem Michal Hocko <mhocko@kernel.org> - 2016-10-12 17:00 +0200
    Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-12 18:10 +0200
      Re: linux.git: printk() problem Michal Hocko <mhocko@kernel.org> - 2016-10-13 08:30 +0200
        Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-13 11:40 +0200
          Re: linux.git: printk() problem Michal Hocko <mhocko@kernel.org> - 2016-10-13 12:10 +0200
            Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-13 12:30 +0200
              Re: linux.git: printk() problem Michal Hocko <mhocko@kernel.org> - 2016-10-13 13:10 +0200
  Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-12 17:50 +0200
    Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-12 18:20 +0200
      Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-12 19:00 +0200
        [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT Joe Perches <joe@perches.com> - 2016-10-12 21:00 +0200
          Re: [PATCH] acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-10-14 00:10 +0200
    Re: linux.git: printk() problem Geert Uytterhoeven <geert@linux-m68k.org> - 2016-10-23 11:30 +0200
      Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-23 20:20 +0200
        Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-23 21:10 +0200
          Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-23 21:40 +0200
            Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-23 21:50 +0200
              Re: linux.git: printk() problem Geert Uytterhoeven <geert@linux-m68k.org> - 2016-10-24 13:20 +0200
              Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-10-24 16:20 +0200
                Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-10-24 16:30 +0200
                Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-24 20:00 +0200
                Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-24 20:00 +0200
                Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-25 04:00 +0200
                Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-25 04:10 +0200
                Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-25 04:30 +0200
                Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-25 06:10 +0200
                Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-25 06:20 +0200
                Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-25 06:30 +0200
                Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-25 06:50 +0200
                Re: linux.git: printk() problem Petr Mladek <pmladek@suse.com> - 2016-10-25 16:50 +0200
                Re: linux.git: printk() problem Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-10-25 04:30 +0200
            Re: linux.git: printk() problem Joe Perches <joe@perches.com> - 2016-10-23 22:40 +0200
              Re: linux.git: printk() problem Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-23 23:20 +0200
        Re: linux.git: printk() problem Steven Rostedt <rostedt@goodmis.org> - 2016-10-25 16:50 +0200

csiph-web