summaryrefslogtreecommitdiff
path: root/arch/um/drivers/ubd_kern.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-10-31 09:07:09 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-31 19:07:00 +0300
commite7f6552f237498c805af9f01aba168b731e0a4ce (patch)
tree609f0e24c234b618bbcde0768a3cfe385ce0d157 /arch/um/drivers/ubd_kern.c
parent2fe30a34a141c2188ff2cdd670d031088d9c5d20 (diff)
downloadlinux-e7f6552f237498c805af9f01aba168b731e0a4ce.tar.xz
[PATCH] uml ubd driver: reformat ubd_config
Pure whitespace and style fixes split out from subsequent patch. Some changes (err -> ret) don't make sense now, only later, but I split them out anyway since they cluttered the patch. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/ubd_kern.c')
-rw-r--r--arch/um/drivers/ubd_kern.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 460d669b4774..eed95dc356e0 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -706,27 +706,36 @@ out:
static int ubd_config(char *str)
{
- int n, err;
+ int n, ret;
str = kstrdup(str, GFP_KERNEL);
- if(str == NULL){
+ if (str == NULL) {
printk(KERN_ERR "ubd_config failed to strdup string\n");
- return(1);
+ ret = 1;
+ goto out;
}
- err = ubd_setup_common(str, &n);
- if(err){
- kfree(str);
- return(-1);
+ ret = ubd_setup_common(str, &n);
+ if (ret) {
+ ret = -1;
+ goto err_free;
+ }
+ if (n == -1) {
+ ret = 0;
+ goto out;
}
- if(n == -1) return(0);
mutex_lock(&ubd_lock);
- err = ubd_add(n);
- if(err)
+ ret = ubd_add(n);
+ if (ret)
ubd_devs[n].file = NULL;
mutex_unlock(&ubd_lock);
- return(err);
+out:
+ return ret;
+
+err_free:
+ kfree(str);
+ goto out;
}
static int ubd_get_config(char *name, char *str, int size, char **error_out)