[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] dm-raid1: remove unused condition



dm-raid1: remove unused condition

mempool_alloc can't fail if __GFP_WAIT is specified, so the condition
that tests if read_record is non-NULL is always true.

Signed-off-by: Mikulas Patocka <mpatocka redhat com>

---
 drivers/md/dm-raid1.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-3.6.2-fast/drivers/md/dm-raid1.c
===================================================================
--- linux-3.6.2-fast.orig/drivers/md/dm-raid1.c	2012-10-15 21:31:57.000000000 +0200
+++ linux-3.6.2-fast/drivers/md/dm-raid1.c	2012-10-15 21:34:20.000000000 +0200
@@ -1198,11 +1198,9 @@ static int mirror_map(struct dm_target *
 		return -EIO;
 
 	read_record = mempool_alloc(ms->read_record_pool, GFP_NOIO);
-	if (likely(read_record)) {
-		dm_bio_record(&read_record->details, bio);
-		map_context->ptr = read_record;
-		read_record->m = m;
-	}
+	dm_bio_record(&read_record->details, bio);
+	map_context->ptr = read_record;
+	read_record->m = m;
 
 	map_bio(m, bio);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]