aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-01 15:19:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-01 15:19:33 +0100
commit071a6dba7d4db57e28f659b30829b1c22b945f4e (patch)
tree392ba2b45e11ec39fc52c3889dbf78a3955cffda /hw/ide
parent2f4c51c0f384d7888a04b4815861e6d5fd244d75 (diff)
parent1eef4ba6be30f8b95c8cda1bcb50a176d680a34d (diff)
downloadqemu-071a6dba7d4db57e28f659b30829b1c22b945f4e.zip
qemu-071a6dba7d4db57e28f659b30829b1c22b945f4e.tar.gz
qemu-071a6dba7d4db57e28f659b30829b1c22b945f4e.tar.bz2
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging
Pull request trivial patches 20200901 # gpg: Signature made Tue 01 Sep 2020 15:08:59 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-for-5.2-pull-request: (44 commits) docs/system: Fix grammar in documentation main-loop: Fix comment hw/display/vga:Remove redundant statement in vga_draw_graphic() hw/intc: fix default registers value in exynos4210_combiner_read() usb/bus: Remove dead assignment in usb_get_fw_dev_path() vfio/platform: Remove dead assignment in vfio_intp_interrupt() hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check() hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions() target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16() target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli() hw/arm/omap1:Remove redundant statement in omap_clkdsp_read() hw/arm/virt-acpi-build:Remove dead assignment in build_madt() linux-user: Add strace support for printing OFD fcntl operations util/vfio-helpers: Unify trace-events size format hw/net/xilinx_axienet: Remove unused code hw/scsi/scsi-disk: Replace magic '512' value by BDRV_SECTOR_SIZE hw/ide/pci: Replace magic '512' value by BDRV_SECTOR_SIZE hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE hw/ide/core: Trivial typo fix ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/ahci.c5
-rw-r--r--hw/ide/atapi.c8
-rw-r--r--hw/ide/core.c2
-rw-r--r--hw/ide/pci.c2
4 files changed, 9 insertions, 8 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;
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:
diff --git a/hw/ide/core.c b/hw/ide/core.c
index d997a78..f76f7e5 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -709,7 +709,7 @@ void ide_cancel_dma_sync(IDEState *s)
/*
* We can't cancel Scatter Gather DMA in the middle of the
* operation or a partial (not full) DMA transfer would reach
- * the storage so we wait for completion instead (we beahve
+ * the storage so we wait for completion instead (we behave
* like if the DMA was completed by the time the guest trying
* to cancel dma with bmdma_cmd_writeb with BM_CMD_START not
* set).
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 5e85c4ad..b50091b 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -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) {