md/raid10: get rid of duplicated conditional expression
authorNamhyung Kim <namhyung@gmail.com>
Mon, 18 Jul 2011 07:38:43 +0000 (17:38 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 18 Jul 2011 07:38:43 +0000 (17:38 +1000)
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 <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c

index 6e846688962fccfd9c7ceddd645192047f7d4d87..d55ae12b2d8c70e38e692bf4fe7cbe9bf861084b 100644 (file)
@@ -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