[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/44] hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE
From: |
Laurent Vivier |
Subject: |
[PULL 27/44] hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE |
Date: |
Tue, 1 Sep 2020 16:09:37 +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-6-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
hw/ide/atapi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 17a9d635d842..14a2b0bb2f8a 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:
--
2.26.2
- [PULL 20/44] hw/i2c: Fix typo in description, (continued)
- [PULL 20/44] hw/i2c: Fix typo in description, Laurent Vivier, 2020/09/01
- [PULL 23/44] mailmap: Add entry for Greg Kurz, 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 21/44] util/qemu-timer: Fix typo in description, Laurent Vivier, 2020/09/01
- [PULL 32/44] linux-user: Add strace support for printing OFD fcntl operations, Laurent Vivier, 2020/09/01
- [PULL 26/44] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE, Laurent Vivier, 2020/09/01
- [PULL 09/44] target/cris: Remove superfluous breaks, Laurent Vivier, 2020/09/01
- [PULL 27/44] hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE,
Laurent Vivier <=
- [PULL 28/44] hw/ide/pci: Replace magic '512' value by BDRV_SECTOR_SIZE, Laurent Vivier, 2020/09/01
- [PULL 25/44] hw/ide/core: Trivial typo fix, 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
- [PULL 35/44] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli(), Laurent Vivier, 2020/09/01
- [PULL 36/44] target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16(), Laurent Vivier, 2020/09/01
- [PULL 33/44] hw/arm/virt-acpi-build:Remove dead assignment in build_madt(), Laurent Vivier, 2020/09/01
- [PULL 39/44] vfio/platform: Remove dead assignment in vfio_intp_interrupt(), Laurent Vivier, 2020/09/01
- [PULL 40/44] usb/bus: Remove dead assignment in usb_get_fw_dev_path(), 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 37/44] hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions(), Laurent Vivier, 2020/09/01