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 --- src/hw/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 97b05cb..9fda011 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; }