[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    [PATCH] 2/4: DM: kcopyd.c: make client_add() return void
From:       Kevin Corry <kevcorry () us ! ibm ! com>
Date:       2004-06-30 19:57:55
Message-ID: 200406301457.55233.kevcorry () us ! ibm ! com
[Download RAW message or body]

kcopyd.c: client_add() can return void instead of an int, which will eliminate
an unnecessary error path in kcopyd_client_create().

Signed-off-by: Kevin Corry <kevcorry@us.ibm.com>

--- diff/drivers/md/kcopyd.c	2004-06-30 08:48:15.384847256 -0500
+++ source/drivers/md/kcopyd.c	2004-06-30 08:48:19.528217368 -0500
@@ -573,12 +573,11 @@
 static DECLARE_MUTEX(_client_lock);
 static LIST_HEAD(_clients);
 
-static int client_add(struct kcopyd_client *kc)
+static void client_add(struct kcopyd_client *kc)
 {
 	down(&_client_lock);
 	list_add(&kc->list, &_clients);
 	up(&_client_lock);
-	return 0;
 }
 
 static void client_del(struct kcopyd_client *kc)
@@ -668,15 +667,7 @@
 		return r;
 	}
 
-	r = client_add(kc);
-	if (r) {
-		dm_io_put(nr_pages);
-		client_free_pages(kc);
-		kfree(kc);
-		kcopyd_exit();
-		return r;
-	}
-
+	client_add(kc);
 	*result = kc;
 	return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic