[PATCH] uml: use kstrdup
authorJeff Dike <jdike@addtoit.com>
Fri, 6 Jan 2006 08:18:48 +0000 (00:18 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:45 +0000 (08:33 -0800)
There were a bunch of calls to uml_strdup dating from before kstrdup was
introduced.  This changes those calls.  It doesn't eliminate the definition
since there is still a couple of calls in userspace code (which should
probably call the libc strdup).

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/drivers/line.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/net_kern.c
arch/um/drivers/ubd_kern.c

index e0fdffa2d542b9a4353bd08912098eb06d17ecf3..c31fc541e2105e393b8f72713732ab6eb08cd55f 100644 (file)
@@ -562,10 +562,11 @@ int line_setup(struct line *lines, unsigned int num, char *init, int all_allowed
 
 int line_config(struct line *lines, unsigned int num, char *str)
 {
-       char *new = uml_strdup(str);
+       char *new;
 
+       new = kstrdup(str, GFP_KERNEL);
        if(new == NULL){
-               printk("line_config - uml_strdup failed\n");
+               printk("line_config - kstrdup failed\n");
                return -ENOMEM;
        }
        return !line_setup(lines, num, new, 0);
@@ -677,10 +678,9 @@ void lines_init(struct line *lines, int nlines)
                INIT_LIST_HEAD(&line->chan_list);
                spin_lock_init(&line->lock);
                if(line->init_str != NULL){
-                       line->init_str = uml_strdup(line->init_str);
+                       line->init_str = kstrdup(line->init_str, GFP_KERNEL);
                        if(line->init_str == NULL)
-                               printk("lines_init - uml_strdup returned "
-                                      "NULL\n");
+                               printk("lines_init - kstrdup returned NULL\n");
                }
        }
 }
index 12c95368124afa58940bba1326ecc4cc1352c4c7..b36786410453771dfd24405630cb453243c49e91 100644 (file)
@@ -563,7 +563,7 @@ int mconsole_init(void)
        }
 
        if(notify_socket != NULL){
-               notify_socket = uml_strdup(notify_socket);
+               notify_socket = kstrdup(notify_socket, GFP_KERNEL);
                if(notify_socket != NULL)
                        mconsole_notify(notify_socket, MCONSOLE_SOCKET,
                                        mconsole_socket_name, 
index 84c73a300acb9ffffe0e2f48748df6ece06831c2..29785f643021a255653d260049e7ce53f7ebb6fb 100644 (file)
@@ -586,7 +586,7 @@ static int net_config(char *str)
        err = eth_parse(str, &n, &str);
        if(err) return(err);
 
-       str = uml_strdup(str);
+       str = kstrdup(str, GFP_KERNEL);
        if(str == NULL){
                printk(KERN_ERR "net_config failed to strdup string\n");
                return(-1);
index 93898917cbe5bb97240b77684e52e608de2ea9cc..1fe0dcd9f4643f0f5eafc544f1799167df8985a5 100644 (file)
@@ -706,7 +706,7 @@ static int ubd_config(char *str)
 {
        int n, err;
 
-       str = uml_strdup(str);
+       str = kstrdup(str, GFP_KERNEL);
        if(str == NULL){
                printk(KERN_ERR "ubd_config failed to strdup string\n");
                return(1);