hw/ide/pci: Replace magic '512' value by BDRV_SECTOR_SIZE
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Fri, 14 Aug 2020 08:28:40 +0000 (10:28 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 1 Sep 2020 09:27:26 +0000 (11:27 +0200)
Use self-explicit definitions instead of magic '512' value.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200814082841.27000-7-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/ide/pci.c

index 5e85c4ad17e01f8c3947e2f5b367e15b61886ad9..b50091b615cbc42d6bacba83132f7a585458a7a6 100644 (file)
@@ -138,7 +138,7 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, int32_t limit)
     int l, len;
 
     pci_dma_sglist_init(&s->sg, pci_dev,
-                        s->nsector / (BMDMA_PAGE_SIZE / 512) + 1);
+                        s->nsector / (BMDMA_PAGE_SIZE / BDRV_SECTOR_SIZE) + 1);
     s->io_buffer_size = 0;
     for(;;) {
         if (bm->cur_prd_len == 0) {