summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorLi Nan <linan122@huawei.com>2023-06-24 01:32:35 +0800
committerSong Liu <song@kernel.org>2023-07-27 00:13:30 -0700
commit02c67a3b72b13951c2ca134bd7065f03ec57946d (patch)
tree203ee6021774545997a747b8da10074fd727486d /drivers/md
parent605eeda6e70f692311b36180f217208d367476f6 (diff)
downloadlinux-02c67a3b72b13951c2ca134bd7065f03ec57946d.tar.gz
linux-02c67a3b72b13951c2ca134bd7065f03ec57946d.tar.bz2
linux-02c67a3b72b13951c2ca134bd7065f03ec57946d.zip
md: remove redundant check in fix_read_error()
In fix_read_error(), 'success' will be checked immediately after assigning it, if it is set to 1 then the loop will break. Checking it again in condition of loop is redundant. Clean it up. Signed-off-by: Li Nan <linan122@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20230623173236.2513554-3-linan666@huaweicloud.com Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid1.c2
-rw-r--r--drivers/md/raid10.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index f834d99a36f6..a68c9cccbf0d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2301,7 +2301,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
d++;
if (d == conf->raid_disks * 2)
d = 0;
- } while (!success && d != read_disk);
+ } while (d != read_disk);
if (!success) {
/* Cannot read from anywhere - mark it bad */
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index abea91a54db1..757687fb90a7 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2783,7 +2783,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
sl++;
if (sl == conf->copies)
sl = 0;
- } while (!success && sl != slot);
+ } while (sl != slot);
rcu_read_unlock();
if (!success) {