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


Groups > linux.kernel > #1637233

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

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [RFC PATCH v2 1/6] um: Use printk instead of printf in make_uml_dir
Date 2017-05-08 08:20 +0200
Message-ID <tEKbv-85-11@gated-at.bofh.it> (permalink)
References <tEKbv-85-5@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>
---
  Changes in v2:
   - Use "%s", __func__ according to checkpatches.pl
---
 arch/um/os-Linux/umid.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..37cfaba 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -35,8 +35,9 @@ static int __init make_uml_dir(void)
 
 		err = -ENOENT;
 		if (home == NULL) {
-			printk(UM_KERN_ERR "make_uml_dir : no value in "
-			       "environment for $HOME\n");
+			printk(UM_KERN_ERR
+				"%s: no value in environment for $HOME\n",
+				__func__);
 			goto err;
 		}
 		strlcpy(dir, home, sizeof(dir));
@@ -50,13 +51,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 "%s : malloc failed, errno = %d\n",
+			__func__, 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 v2 0/6] um: Output messages to stderr and support quiet option Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:20 +0200
  [RFC PATCH v2 2/6] um: Add os_info() for pre-boot information messages Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:20 +0200
  [RFC PATCH v2 1/6] um: Use printk instead of printf in make_uml_dir Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:20 +0200
  [RFC PATCH v2 6/6] um: console: Ignore console= option Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:30 +0200
  [RFC PATCH v2 4/6] um: Add os_warn() for pre-boot warning/error messages Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:30 +0200
  [RFC PATCH v2 5/6] um: Use os_warn to print out pre-boot warning/error messages Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:30 +0200
  [RFC PATCH v2 3/6] um: Use os_info for the messages on normal path Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-08 08:30 +0200

csiph-web