]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
md/raid10: fix set but not used variable in sync_request_write()
authorJohn Garry <john.g.garry@oracle.com>
Wed, 9 Jul 2025 10:48:14 +0000 (10:48 +0000)
committerYu Kuai <yukuai3@huawei.com>
Wed, 16 Jul 2025 16:02:05 +0000 (00:02 +0800)
Building with W=1 reports the following:

drivers/md/raid10.c: In function ‘sync_request_write’:
drivers/md/raid10.c:2441:21: error: variable ‘d’ set but not used [-Werror=unused-but-set-variable]
 2441 |                 int d;
      |                     ^
cc1: all warnings being treated as errors

Remove the usage of that variable.

Fixes: 752d0464b78a ("md: clean up accounting for issued sync IO")
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/linux-raid/20250709104814.2307276-1-john.g.garry@oracle.com
Signed-off-by: Yu Kuai <yukuai@kernel.org>
drivers/md/raid10.c

index b74780af4c220db77d1c3d502366faed9fb71590..30b860d05dcc39ad167c13c29428eff4a3da8785 100644 (file)
@@ -2438,15 +2438,12 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
         * that are active
         */
        for (i = 0; i < conf->copies; i++) {
-               int d;
-
                tbio = r10_bio->devs[i].repl_bio;
                if (!tbio || !tbio->bi_end_io)
                        continue;
                if (r10_bio->devs[i].bio->bi_end_io != end_sync_write
                    && r10_bio->devs[i].bio != fbio)
                        bio_copy_data(tbio, fbio);
-               d = r10_bio->devs[i].devnum;
                atomic_inc(&r10_bio->remaining);
                submit_bio_noacct(tbio);
        }