diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-08-14 10:28:39 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-09-01 11:27:26 +0200 |
commit | a71f2d22628cae4fcb3df6fcc44e63e213d6ee18 (patch) | |
tree | f7cd6d92df16353d817afef8b528ec0ae400c4d5 /hw/ide | |
parent | 075f32d386aa93afa6e038e1e35fe4a29ffc8e80 (diff) | |
download | qemu-a71f2d22628cae4fcb3df6fcc44e63e213d6ee18.zip qemu-a71f2d22628cae4fcb3df6fcc44e63e213d6ee18.tar.gz qemu-a71f2d22628cae4fcb3df6fcc44e63e213d6ee18.tar.bz2 |
hw/ide/atapi: 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-6-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/atapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 17a9d63..14a2b0b 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -824,9 +824,9 @@ static void cmd_get_configuration(IDEState *s, uint8_t *buf) * * Only a problem if the feature/profiles grow. */ - if (max_len > 512) { + if (max_len > BDRV_SECTOR_SIZE) { /* XXX: assume 1 sector */ - max_len = 512; + max_len = BDRV_SECTOR_SIZE; } memset(buf, 0, max_len); @@ -1186,8 +1186,8 @@ static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf) } } - memset(buf, 0, max_len > IDE_DMA_BUF_SECTORS * 512 + 4 ? - IDE_DMA_BUF_SECTORS * 512 + 4 : max_len); + memset(buf, 0, max_len > IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 ? + IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 : max_len); switch (format) { case 0x00 ... 0x7f: |