Skip to contentSkip to conversation

md/raid5: remove unused working_disks variable

PATCH Applied Tom Rix 2 participants 2 messages Mar 27, 2023 – Mar 28, 2023 MD RAID

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH v2 1/1 md/raid5: remove unused working_disks variable

clang with W=1 reports
drivers/md/raid5.c:7719:6: error: variable 'working_disks'
set but not used [-Werror,-Wunused-but-set-variable]

        int working_disks = 0;
            ^

This variable is not used so remove it.

---
v2: remove brances

---
 drivers/md/raid5.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/md/raid5.c +1 -4
index 7b820b81d8c2..812a12e3e41a 100644
@@ -7716,7 +7716,6 @@ static void raid5_set_io_opt(struct r5conf *conf)
 static int raid5_run(struct mddev *mddev)
 {
 	struct r5conf *conf;
-	int working_disks = 0;
 	int dirty_parity_disks = 0;
 	struct md_rdev *rdev;
 	struct md_rdev *journal_dev = NULL;
@@ -7912,10 +7911,8 @@ static int raid5_run(struct mddev *mddev)
 			pr_warn("md: cannot handle concurrent replacement and reshape.\n");
 			goto abort;
 		}
-		if (test_bit(In_sync, &rdev->flags)) {
-			working_disks++;
+		if (test_bit(In_sync, &rdev->flags))
 			continue;
-		}
 		/* This disc is not fully in-sync.  However if it
 		 * just stored parity (beyond the recovery_offset),
 		 * when we don't need to be concerned about the
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Tom Rix

clang with W=1 reports
drivers/md/raid5.c:7719:6: error: variable 'working_disks'
set but not used [-Werror,-Wunused-but-set-variable]

        int working_disks = 0;
            ^

This variable is not used so remove it.

Applied to md-next, with Yu Kuai's Reviewed-by.

Thanks,
Song

Quoted 33 lines

---
v2: remove brances

---
 drivers/md/raid5.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/md/raid5.c +1 -5
index 7b820b81d8c2..812a12e3e41a 100644
@@ -7716,7 +7716,6 @@ static void raid5_set_io_opt(struct r5conf *conf)
 static int raid5_run(struct mddev *mddev)
 {
        struct r5conf *conf;
-       int working_disks = 0;
        int dirty_parity_disks = 0;
        struct md_rdev *rdev;
        struct md_rdev *journal_dev = NULL;
@@ -7912,10 +7911,8 @@ static int raid5_run(struct mddev *mddev)
                        pr_warn("md: cannot handle concurrent replacement and reshape.\n");
                        goto abort;
                }
-               if (test_bit(In_sync, &rdev->flags)) {
-                       working_disks++;
+               if (test_bit(In_sync, &rdev->flags))
                        continue;
-               }
                /* This disc is not fully in-sync.  However if it
                 * just stored parity (beyond the recovery_offset),
                 * when we don't need to be concerned about the
--

2.27.0