Skip to content

Commit

Permalink
md/raid10: get rid of duplicated conditional expression
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and NeilBrown committed Jul 18, 2011
1 parent 1765a36 commit 2c4193d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c4193d

Please sign in to comment.