aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-08-14 10:28:38 +0200
committerLaurent Vivier <laurent@vivier.eu>2020-09-01 11:27:26 +0200
commit075f32d386aa93afa6e038e1e35fe4a29ffc8e80 (patch)
treedae2904493b8eb8bb5cce29955d7163a74cc8fa3 /hw/ide
parent68b57b0dd63983041b4678cc5cb5772351ee79f0 (diff)
downloadqemu-075f32d386aa93afa6e038e1e35fe4a29ffc8e80.zip
qemu-075f32d386aa93afa6e038e1e35fe4a29ffc8e80.tar.gz
qemu-075f32d386aa93afa6e038e1e35fe4a29ffc8e80.tar.bz2
hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE
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>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/ahci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 009120f..b696c62 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;