aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Verkamp <daniel@drv.nu>2017-02-23 23:27:56 -0700
committerKevin O'Connor <kevin@koconnor.net>2017-03-02 09:48:17 -0500
commitd8a6c846924df07af2e48796af8b0a0f03e94f9a (patch)
treefcfcce48911ff1bc2e6c86eff07d937ff159e2f1
parent2e82b465fbdb46efdc2ebb638aef17fa7f665dc5 (diff)
downloadseabios-d8a6c846924df07af2e48796af8b0a0f03e94f9a.tar.gz
nvme: fix extraction of status code bits
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>
-rw-r--r--src/hw/nvme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hw/nvme.c b/src/hw/nvme.c
index 97b05cb7..9fda011a 100644
--- a/src/hw/nvme.c
+++ b/src/hw/nvme.c
@@ -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;
}