[PATCH] 2/4: DM: kcopyd.c: make client_add() return void

From: Kevin Corry
Date: Wed Jun 30 2004 - 14:59:42 EST


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@xxxxxxxxxx>

--- 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/