[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/44] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE
From: |
Laurent Vivier |
Subject: |
[PULL 26/44] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE |
Date: |
Tue, 1 Sep 2020 16:09:36 +0200 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
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-5-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
hw/ide/ahci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 009120f88b78..b696c6291a38 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1151,7 +1151,7 @@ static void process_ncq_command(AHCIState *s, int port,
uint8_t *cmd_fis,
if (!ncq_tfs->sector_count) {
ncq_tfs->sector_count = 0x10000;
}
- size = ncq_tfs->sector_count * 512;
+ size = ncq_tfs->sector_count * BDRV_SECTOR_SIZE;
ahci_populate_sglist(ad, &ncq_tfs->sglist, ncq_tfs->cmdh, size, 0);
if (ncq_tfs->sglist.size < size) {
@@ -1703,7 +1703,8 @@ static int ahci_state_post_load(void *opaque, int
version_id)
return -1;
}
ahci_populate_sglist(ncq_tfs->drive, &ncq_tfs->sglist,
- ncq_tfs->cmdh, ncq_tfs->sector_count * 512,
+ ncq_tfs->cmdh,
+ ncq_tfs->sector_count * BDRV_SECTOR_SIZE,
0);
if (ncq_tfs->sector_count != ncq_tfs->sglist.size >> 9) {
return -1;
--
2.26.2
- [PULL 11/44] hw/i386/kvm/ioapic.c: fix typo in error message, (continued)
- [PULL 11/44] hw/i386/kvm/ioapic.c: fix typo in error message, Laurent Vivier, 2020/09/01
- [PULL 14/44] qemu-options.hx: Fix typo for netdev documentation, Laurent Vivier, 2020/09/01
- [PULL 08/44] target/sh4: Remove superfluous breaks, Laurent Vivier, 2020/09/01
- [PULL 19/44] .mailmap: Update Paul Burton email address, Laurent Vivier, 2020/09/01
- [PULL 07/44] hw: Remove superfluous breaks, Laurent Vivier, 2020/09/01
- [PULL 24/44] docs/system/target-avr: Improve the AVR docs and add to MAINTAINERS, Laurent Vivier, 2020/09/01
- [PULL 05/44] vnc: Remove the superfluous break, Laurent Vivier, 2020/09/01
- [PULL 06/44] block/vmdk: Remove superfluous breaks, Laurent Vivier, 2020/09/01
- [PULL 32/44] linux-user: Add strace support for printing OFD fcntl operations, Laurent Vivier, 2020/09/01
- [PULL 21/44] util/qemu-timer: Fix typo in description, Laurent Vivier, 2020/09/01
- [PULL 26/44] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE,
Laurent Vivier <=
- [PULL 09/44] target/cris: Remove superfluous breaks, Laurent Vivier, 2020/09/01
- [PULL 28/44] hw/ide/pci: Replace magic '512' value by BDRV_SECTOR_SIZE, Laurent Vivier, 2020/09/01
- [PULL 27/44] hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE, Laurent Vivier, 2020/09/01
- [PULL 34/44] hw/arm/omap1:Remove redundant statement in omap_clkdsp_read(), Laurent Vivier, 2020/09/01
- [PULL 43/44] main-loop: Fix comment, Laurent Vivier, 2020/09/01
- [PULL 35/44] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli(), Laurent Vivier, 2020/09/01
- [PULL 44/44] docs/system: Fix grammar in documentation, Laurent Vivier, 2020/09/01
- [PULL 38/44] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check(), Laurent Vivier, 2020/09/01
- [PULL 41/44] hw/intc: fix default registers value in exynos4210_combiner_read(), Laurent Vivier, 2020/09/01
- [PULL 29/44] hw/scsi/scsi-disk: Replace magic '512' value by BDRV_SECTOR_SIZE, Laurent Vivier, 2020/09/01