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


Groups > linux.kernel > #1632785

[RFC PATCH 1/7] um: Use printk instead of printf in make_uml_dir

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [RFC PATCH 1/7] um: Use printk instead of printf in make_uml_dir
Date 2017-04-28 12:30 +0200
Message-ID <tBbjY-614-31@gated-at.bofh.it> (permalink)
References <tBbjX-614-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since this function will be called after printk buffer
initialized, use printk as other functions do.

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

diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..b94a416 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -50,13 +50,15 @@ static int __init make_uml_dir(void)
 	err = -ENOMEM;
 	uml_dir = malloc(strlen(dir) + 1);
 	if (uml_dir == NULL) {
-		printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+		printk(UM_KERN_ERR "make_uml_dir : malloc failed, "
+			"errno = %d\n", errno);
 		goto err;
 	}
 	strcpy(uml_dir, dir);
 
 	if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
-	        printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
+		printk(UM_KERN_ERR "Failed to mkdir '%s': %s\n",
+			uml_dir, strerror(errno));
 		err = -errno;
 		goto err_free;
 	}

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


Thread

[RFC PATCH 0/7] um: Fix printf usage and support quiet option Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200
  [RFC PATCH 3/7] um: Make non_fatal non-static for other files Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200
  [RFC PATCH 2/7] um: Use non_fatal() in check_coredump_limit Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200
  [RFC PATCH 5/7] um: Print out fatal error in stderr Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200
    Re: [RFC PATCH 5/7] um: Print out fatal error in stderr Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-29 13:30 +0200
  [RFC PATCH 1/7] um: Use printk instead of printf in make_uml_dir Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200
  [RFC PATCH 4/7] um: Use non_fatal() for non-fatal information/warning messages Masami Hiramatsu <mhiramat@kernel.org> - 2017-04-28 12:30 +0200

csiph-web