Skip to contentSkip to conversation

qtest/ahci: fix redundant assertion

PATCH Applied John Snow 2 participants 3 messages Sep 21, 2015 – Oct 4, 2015

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH 1/1 qtest/ahci: fix redundant assertion

Fixes https://bugs.launchpad.net/qemu/+bug/1497711

(!ncq || (ncq && lba48)) is the same as
(!ncq || lba48).

The intention is simply: "If a command is NCQ,
it must also be LBA48."

---
 tests/libqos/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/libqos/ahci.c +1 -1
index cf66b3e..adb2665 100644
@@ -742,7 +742,7 @@ AHCICommand *ahci_command_create(uint8_t command_name)
     g_assert(!(props->lba28 && props->lba48));
     g_assert(!(props->read && props->write));
     g_assert(!props->size || props->data);
-    g_assert(!props->ncq || (props->ncq && props->lba48));
+    g_assert(!props->ncq || props->lba48);
 
     /* Defaults and book-keeping */
     cmd->props = props;
Signature · 1 line
2.4.3
author
#1 lore raw
Quoted 19 lines · John Snow

Fixes https://bugs.launchpad.net/qemu/+bug/1497711

(!ncq || (ncq && lba48)) is the same as
(!ncq || lba48).

The intention is simply: "If a command is NCQ,
it must also be LBA48."

---
 tests/libqos/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/libqos/ahci.c +0 -0
index cf66b3e..adb2665 100644

tests/libqos/ahci.c AHCICommand *ahci_command_create(uint8_t command_name) · line 748

Quoted 8 lines
tests/libqos/ahci.c +1 -1
@@ -742,7 +742,7 @@ AHCICommand *ahci_command_create(uint8_t command_name)
     g_assert(!(props->lba28 && props->lba48));
     g_assert(!(props->read && props->write));
     g_assert(!props->size || props->data);
-    g_assert(!props->ncq || (props->ncq && props->lba48));
+    g_assert(!props->ncq || props->lba48);
 
     /* Defaults and book-keeping */
     cmd->props = props;

Tentatively staged. Barring objections, I will send a pull request for this tomorrow, thanks.

https://github.com/jnsnow/qemu/commits/ide
https://github.com/jnsnow/qemu.git

--js