Re: [PATCH] md/raid10: fix set but not used variable in sync_request_write()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

在 2025/07/16 15:35, John Garry 写道:
A friendly reminder on this one...


Oops, I do missed this patch, I'll pick this when I return home.

Thanks,
Kuai

On 09/07/2025 11:48, John Garry wrote:
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@xxxxxxxxxx>

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index b74780af4c22..30b860d05dcc 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -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);
      }


.






[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux