All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, jsnow@redhat.com
Subject: [Qemu-devel] [PULL 04/19] libqos/ahci: Fix sector set method
Date: Fri, 22 May 2015 15:59:37 -0400	[thread overview]
Message-ID: <1432324792-9373-5-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1432324792-9373-1-git-send-email-jsnow@redhat.com>

|| probably does not mean the same thing as |.

Additionally, allow users to submit a prd_size of 0
to indicate that they'd like to continue using the default.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1430417242-11859-3-git-send-email-jsnow@redhat.com
---
 tests/libqos/ahci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 229409b..8c8fd89 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -769,7 +769,7 @@ void ahci_command_set_offset(AHCICommand *cmd, uint64_t lba_sect)
     fis->lba_lo[1] = (lba_sect >> 8) & 0xFF;
     fis->lba_lo[2] = (lba_sect >> 16) & 0xFF;
     if (cmd->props->lba28) {
-        fis->device = (fis->device & 0xF0) || (lba_sect >> 24) & 0x0F;
+        fis->device = (fis->device & 0xF0) | ((lba_sect >> 24) & 0x0F);
     }
     fis->lba_hi[0] = (lba_sect >> 24) & 0xFF;
     fis->lba_hi[1] = (lba_sect >> 32) & 0xFF;
@@ -787,7 +787,9 @@ void ahci_command_set_sizes(AHCICommand *cmd, uint64_t xbytes,
     /* Each PRD can describe up to 4MiB, and must not be odd. */
     g_assert_cmphex(prd_size, <=, 4096 * 1024);
     g_assert_cmphex(prd_size & 0x01, ==, 0x00);
-    cmd->prd_size = prd_size;
+    if (prd_size) {
+        cmd->prd_size = prd_size;
+    }
     cmd->xbytes = xbytes;
     cmd->fis.count = (cmd->xbytes / AHCI_SECTOR_SIZE);
     cmd->header.prdtl = size_to_prdtl(cmd->xbytes, cmd->prd_size);
-- 
2.1.0

  parent reply	other threads:[~2015-05-22 20:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 19:59 [Qemu-devel] [PULL 00/19] Ide patches John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 01/19] configure: require glib 2.22 John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 02/19] glib: remove stale compat functions John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 03/19] libqos/ahci: Add halted command helpers John Snow
2015-05-22 19:59 ` John Snow [this message]
2015-05-22 19:59 ` [Qemu-devel] [PULL 05/19] libqos: Add migration helpers John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 06/19] ich9/ahci: Enable Migration John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 07/19] qtest/ahci: Add migration test John Snow
2015-11-05 15:26   ` Peter Maydell
2015-11-05 16:52     ` John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 08/19] qtest/ahci: add migrate dma test John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 09/19] qtest/ahci: add flush migrate test John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 10/19] qtest/ahci: add halted dma test John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 11/19] qtest/ahci: add migrate " John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 12/19] qtest: allow arbitrarily long sends John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 13/19] qtest: Add base64 encoded read/write John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 14/19] qtest: add memset to qtest protocol John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 15/19] libqos/ahci: Swap memread/write with bufread/write John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 16/19] qtest: pre-buffer hex nibs John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 17/19] macio: move unaligned DMA read code into separate pmac_dma_read() function John Snow
2015-05-22 19:59 ` [Qemu-devel] [PULL 18/19] macio: move unaligned DMA write code into separate pmac_dma_write() function John Snow
2015-07-27 22:00   ` Aurelien Jarno
2015-07-28  8:52     ` Mark Cave-Ayland
2015-07-28 18:02       ` Aurelien Jarno
2015-08-01 11:21         ` Mark Cave-Ayland
2015-08-01 12:37           ` Aurelien Jarno
2015-08-01 16:09             ` Mark Cave-Ayland
2015-07-30 10:10       ` Kevin Wolf
2015-07-31 20:37       ` John Snow
2015-08-02 13:02         ` Mark Cave-Ayland
2015-05-22 19:59 ` [Qemu-devel] [PULL 19/19] ahci: do not remap clb/fis unconditionally John Snow
2015-05-26 11:54 ` [Qemu-devel] [PULL 00/19] Ide patches Peter Maydell

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=1432324792-9373-5-git-send-email-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.