Skip to contentSkip to conversation

dm raid: remove unused d variable

PATCH In review Tom Rix 2 participants 2 messages Mar 30, 2023 – Mar 31, 2023 Device mapper

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 dm raid: remove unused d variable

clang with W=1 reports drivers/md/dm-raid.c:2212:15: error: variable
'd' set but not used [-Werror,-Wunused-but-set-variable]

        unsigned int d;
                     ^

This variable is not used so remove it.

---
 drivers/md/dm-raid.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/md/dm-raid.c +0 -4
index 60632b409b80..2dfd51509647 100644
@@ -2209,7 +2209,6 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
 static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev)
 {
 	int role;
-	unsigned int d;
 	struct mddev *mddev = &rs->md;
 	uint64_t events_sb;
 	uint64_t failed_devices[DISKS_ARRAY_ELEMS];
@@ -2324,7 +2323,6 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev)
 	 *    to provide capacity for redundancy or during reshape
 	 *    to add capacity to grow the raid set.
 	 */
-	d = 0;
 	rdev_for_each(r, mddev) {
 		if (test_bit(Journal, &rdev->flags))
 			continue;
@@ -2340,8 +2338,6 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev)
 			if (test_bit(FirstUse, &r->flags))
 				rebuild_and_new++;
 		}
-
-		d++;
 	}
 
 	if (new_devs == rs->raid_disks || !rebuilds) {
Signature · 1 line
2.27.0
#1 lore raw
Quoted 45 lines · Tom Rix

clang with W=1 reports drivers/md/dm-raid.c:2212:15: error: variable
'd' set but not used [-Werror,-Wunused-but-set-variable]

        unsigned int d;
                     ^

This variable is not used so remove it.

---
 drivers/md/dm-raid.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/md/dm-raid.c +0 -1
index 60632b409b80..2dfd51509647 100644
@@ -2209,7 +2209,6 @@ static int super_load(struct md_rdev *rdev, struct
 md_rdev *refdev)
 static int super_init_validation(struct raid_set *rs, struct md_rdev
 *rdev)
 {
        int role;
-       unsigned int d;
        struct mddev *mddev = &rs->md;
        uint64_t events_sb;
        uint64_t failed_devices[DISKS_ARRAY_ELEMS];
drivers/md/dm-raid.c +0 -1
@@ -2324,7 +2323,6 @@ static int super_init_validation(struct raid_set
 *rs, struct md_rdev *rdev)
         *    to provide capacity for redundancy or during reshape
         *    to add capacity to grow the raid set.
         */
-       d = 0;
        rdev_for_each(r, mddev) {
                if (test_bit(Journal, &rdev->flags))
                        continue;
drivers/md/dm-raid.c +0 -2
@@ -2340,8 +2338,6 @@ static int super_init_validation(struct raid_set
 *rs, struct md_rdev *rdev)
                        if (test_bit(FirstUse, &r->flags))
                                rebuild_and_new++;
                }
-
-               d++;
        }
 
        if (new_devs == rs->raid_disks || !rebuilds) {
Quoted 9 lines

--
2.27.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Acked

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel