]> git.baikalelectronics.ru Git - kernel.git/commitdiff
raid5: fix duplicate checks for rdev->saved_raid_disk
authorJackie Liu <liuyun01@kylinos.cn>
Thu, 7 Jul 2022 09:08:34 +0000 (17:08 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:46 +0000 (17:22 -0600)
'first' will always be greater than or equal to 0, it is unnecessary to
repeat the 0 check, clean it up.

Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid5.c

index 6a6f7d969198327d5d001eeed8877c6bf5dc8ade..9270a714ccebd88b68efbc34c314fbe4ede46d99 100644 (file)
@@ -8263,8 +8263,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
         * find the disk ... but prefer rdev->saved_raid_disk
         * if possible.
         */
-       if (rdev->saved_raid_disk >= 0 &&
-           rdev->saved_raid_disk >= first &&
+       if (rdev->saved_raid_disk >= first &&
            rdev->saved_raid_disk <= last &&
            conf->disks[rdev->saved_raid_disk].rdev == NULL)
                first = rdev->saved_raid_disk;