All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Jeff Dike <jdike@addtoit.com>, Richard Weinberger <richard@nod.at>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 6/7] um: Suppress non-fatal messages when quiet
Date: Fri, 28 Apr 2017 19:26:48 +0900	[thread overview]
Message-ID: <149337519863.14717.14783366681891976827.stgit@devbox> (raw)
In-Reply-To: <149337478135.14717.16640886389891283.stgit@devbox>

Suppress non-fatal boot messages when "quiet" kernel
parameter is given.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/um/os-Linux/util.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index 8745f23..7afcb41 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -13,6 +13,7 @@
 #include <wait.h>
 #include <sys/mman.h>
 #include <sys/utsname.h>
+#include <init.h>
 #include <os.h>
 
 void stack_protections(unsigned long address)
@@ -153,10 +154,25 @@ void um_early_printk(const char *s, unsigned int n)
 	printf("%.*s", n, s);
 }
 
+static int quiet_non_fatal;
+
+static int __init quiet_cmd_param(char *str, int *add)
+{
+	quiet_non_fatal = 1;
+	return 0;
+}
+
+__uml_setup("quiet", quiet_cmd_param,
+"quiet\n"
+"    Turns off non-fatal message during boot.\n\n");
+
 void non_fatal(const char *fmt, ...)
 {
 	va_list list;
 
+	if (quiet_non_fatal)
+		return;
+
 	va_start(list, fmt);
 	vfprintf(stderr, fmt, list);
 	va_end(list);



  parent reply	other threads:[~2017-04-28 10:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 10:19 [RFC PATCH 0/7] um: Fix printf usage and support quiet option Masami Hiramatsu
2017-04-28 10:21 ` [RFC PATCH 1/7] um: Use printk instead of printf in make_uml_dir Masami Hiramatsu
2017-04-28 10:22 ` [RFC PATCH 2/7] um: Use non_fatal() in check_coredump_limit Masami Hiramatsu
2017-04-28 10:23 ` [RFC PATCH 3/7] um: Make non_fatal non-static for other files Masami Hiramatsu
2017-04-28 10:24 ` [RFC PATCH 4/7] um: Use non_fatal() for non-fatal information/warning messages Masami Hiramatsu
2017-04-28 10:25 ` [RFC PATCH 5/7] um: Print out fatal error in stderr Masami Hiramatsu
2017-04-29 11:26   ` Masami Hiramatsu
2017-04-28 10:26 ` Masami Hiramatsu [this message]
2017-04-28 10:27 ` [RFC PATCH 7/7] um: console: Ignore console= option Masami Hiramatsu

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=149337519863.14717.14783366681891976827.stgit@devbox \
    --to=mhiramat@kernel.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.