From: Daniel Verkamp Date: Fri, 24 Feb 2017 06:27:56 +0000 (-0700) Subject: nvme: fix extraction of status code bits X-Git-Tag: rel-1.11.0~53 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d8a6c846924df07af2e48796af8b0a0f03e94f9a;p=seabios.git 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 Reviewed-by: Philippe Mathieu-Daudé --- 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; }