[PATCH 1/2] md/raid10: a simple cleanup for fix_recovery_read_error
From: linan666
Date: Mon Jun 26 2023 - 23:45:37 EST
From: Li Nan <linan122@xxxxxxxxxx>
There is no need to use a new variable 'rdev2' for write device since
'rdev' is not used again later. Use 'rdev' directly. Assigning return
value to 'ok' is also unnecessary. Clean it up.
Signed-off-by: Li Nan <linan122@xxxxxxxxxx>
---
drivers/md/raid10.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 4fcfcb350d2b..5105273f60e9 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2590,10 +2590,9 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
if (rdev != conf->mirrors[dw].rdev) {
/* need bad block on destination too */
- struct md_rdev *rdev2 = conf->mirrors[dw].rdev;
+ rdev = conf->mirrors[dw].rdev;
addr = r10_bio->devs[1].addr + sect;
- ok = rdev_set_badblocks(rdev2, addr, s, 0);
- if (!ok) {
+ if (!rdev_set_badblocks(rdev, addr, s, 0)) {
/* just abort the recovery */
pr_notice("md/raid10:%s: recovery aborted due to read error\n",
mdname(mddev));
--
2.39.2