From: Namhyung Kim Date: Mon, 18 Jul 2011 07:38:43 +0000 (+1000) Subject: md/raid10: get rid of duplicated conditional expression X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c4193df379bb89114ff60d4b0fa66131abe6a75;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git md/raid10: get rid of duplicated conditional expression Variable 'first' is initialized to zero and updated to @rdev->raid_disk only if it is greater than 0. Thus condition '>= first' always implies '>= 0' so the latter is not needed. Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 6e846688962f..d55ae12b2d8c 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1093,8 +1093,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) if (rdev->raid_disk >= 0) first = last = rdev->raid_disk; - if (rdev->saved_raid_disk >= 0 && - rdev->saved_raid_disk >= first && + if (rdev->saved_raid_disk >= first && conf->mirrors[rdev->saved_raid_disk].rdev == NULL) mirror = rdev->saved_raid_disk; else