]> xenbits.xensource.com Git - seabios.git/commitdiff
nvme: fix extraction of status code bits
authorDaniel Verkamp <daniel@drv.nu>
Fri, 24 Feb 2017 06:27:56 +0000 (23:27 -0700)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 2 Mar 2017 14:48:17 +0000 (09:48 -0500)
The status code field is 8 bits wide starting at bit 1; the previous
code would truncate the top bit.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
src/hw/nvme.c

index 97b05cb74841be8b6c473a26c27e10073f882629..9fda011aea1880540b38ce555b648ca12d33c8f6 100644 (file)
@@ -74,7 +74,7 @@ nvme_poll_cq(struct nvme_cq *cq)
 static int
 nvme_is_cqe_success(struct nvme_cqe const *cqe)
 {
-    return (cqe->status & 0xFF) >> 1 == 0;
+    return ((cqe->status >> 1) & 0xFF) == 0;
 }