From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, "Li Qiang" <liq3ea@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Stefano Garzarella" <sgarzare@redhat.com>
Subject: [PULL 26/44] hw/ide/ahci: Replace magic '512' value by BDRV_SECTOR_SIZE
Date: Tue, 1 Sep 2020 16:09:36 +0200 [thread overview]
Message-ID: <20200901140954.889743-27-laurent@vivier.eu> (raw)
In-Reply-To: <20200901140954.889743-1-laurent@vivier.eu>
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
next prev parent reply other threads:[~2020-09-01 14:22 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 14:09 [PULL 00/44] Trivial branch for 5.2 patches Laurent Vivier
2020-09-01 14:09 ` [PULL 01/44] hw/register: Document register_init_block @memory_size Laurent Vivier
2020-09-01 14:09 ` [PULL 02/44] target/arm/kvm: Remove superfluous break Laurent Vivier
2020-09-01 14:09 ` [PULL 03/44] target/ppc: Remove superfluous breaks Laurent Vivier
2020-09-01 14:09 ` [PULL 04/44] scsi: " Laurent Vivier
2020-09-01 14:09 ` [PULL 05/44] vnc: Remove the superfluous break Laurent Vivier
2020-09-01 14:09 ` [PULL 06/44] block/vmdk: Remove superfluous breaks Laurent Vivier
2020-09-01 14:09 ` [PULL 07/44] hw: " Laurent Vivier
2020-09-01 14:09 ` [PULL 08/44] target/sh4: " Laurent Vivier
2020-09-01 14:09 ` [PULL 09/44] target/cris: " Laurent Vivier
2020-09-01 14:09 ` [PULL 10/44] hw/net/can: Add missing fallthrough statements Laurent Vivier
2020-09-01 14:09 ` [PULL 11/44] hw/i386/kvm/ioapic.c: fix typo in error message Laurent Vivier
2020-09-01 14:09 ` [PULL 12/44] hw/isa/isa-superio: Fix IDE controller realization Laurent Vivier
2020-09-01 14:09 ` [PULL 13/44] stubs/cmos: Use correct include Laurent Vivier
2020-09-01 14:09 ` [PULL 14/44] qemu-options.hx: Fix typo for netdev documentation Laurent Vivier
2020-09-01 14:09 ` [PULL 15/44] hw/core/sysbus: Fix a typo Laurent Vivier
2020-09-01 14:09 ` [PULL 16/44] hw/core/sysbus: Assert memory region index is in range Laurent Vivier
2020-09-01 14:09 ` [PULL 17/44] Revert "mailmap: Update philmd email address" Laurent Vivier
2020-09-01 14:09 ` [PULL 18/44] docs: Fix broken links Laurent Vivier
2020-09-01 14:09 ` [PULL 19/44] .mailmap: Update Paul Burton email address Laurent Vivier
2020-09-01 14:09 ` [PULL 20/44] hw/i2c: Fix typo in description Laurent Vivier
2020-09-01 14:09 ` [PULL 21/44] util/qemu-timer: " Laurent Vivier
2020-09-01 14:09 ` [PULL 22/44] util/vfio-helpers: " Laurent Vivier
2020-09-01 14:09 ` [PULL 23/44] mailmap: Add entry for Greg Kurz Laurent Vivier
2020-09-01 14:09 ` [PULL 24/44] docs/system/target-avr: Improve the AVR docs and add to MAINTAINERS Laurent Vivier
2020-09-01 14:09 ` [PULL 25/44] hw/ide/core: Trivial typo fix Laurent Vivier
2020-09-01 14:09 ` Laurent Vivier [this message]
2020-09-01 14:09 ` [PULL 27/44] hw/ide/atapi: Replace magic '512' value by BDRV_SECTOR_SIZE Laurent Vivier
2020-09-01 14:09 ` [PULL 28/44] hw/ide/pci: " Laurent Vivier
2020-09-01 14:09 ` [PULL 29/44] hw/scsi/scsi-disk: " Laurent Vivier
2020-09-01 14:09 ` [PULL 30/44] hw/net/xilinx_axienet: Remove unused code Laurent Vivier
2020-09-01 14:09 ` [PULL 31/44] util/vfio-helpers: Unify trace-events size format Laurent Vivier
2020-09-01 14:09 ` [PULL 32/44] linux-user: Add strace support for printing OFD fcntl operations Laurent Vivier
2020-09-01 14:09 ` [PULL 33/44] hw/arm/virt-acpi-build:Remove dead assignment in build_madt() Laurent Vivier
2020-09-01 14:09 ` [PULL 34/44] hw/arm/omap1:Remove redundant statement in omap_clkdsp_read() Laurent Vivier
2020-09-01 14:09 ` [PULL 35/44] target/arm/translate-a64:Remove dead assignment in handle_scalar_simd_shli() Laurent Vivier
2020-09-01 14:09 ` [PULL 36/44] target/arm/translate-a64:Remove redundant statement in disas_simd_two_reg_misc_fp16() Laurent Vivier
2020-09-01 14:09 ` [PULL 37/44] hw/virtio/vhost-user:Remove dead assignment in scrub_shadow_regions() Laurent Vivier
2020-09-01 14:09 ` [PULL 38/44] hw/net/virtio-net:Remove redundant statement in virtio_net_rsc_tcp_ctrl_check() Laurent Vivier
2020-09-01 14:09 ` [PULL 39/44] vfio/platform: Remove dead assignment in vfio_intp_interrupt() Laurent Vivier
2020-09-01 14:09 ` [PULL 40/44] usb/bus: Remove dead assignment in usb_get_fw_dev_path() Laurent Vivier
2020-09-01 14:09 ` [PULL 41/44] hw/intc: fix default registers value in exynos4210_combiner_read() Laurent Vivier
2020-09-01 14:09 ` [PULL 42/44] hw/display/vga:Remove redundant statement in vga_draw_graphic() Laurent Vivier
2020-09-01 14:09 ` [PULL 43/44] main-loop: Fix comment Laurent Vivier
2020-09-01 14:09 ` [PULL 44/44] docs/system: Fix grammar in documentation Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200901140954.889743-27-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=f4bug@amsat.org \
--cc=liq3ea@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).