[SeaBIOS] [PATCH 4/5] nvme: fix extraction of status code bits

Philippe Mathieu-Daudé f4bug at amsat.org
Wed Mar 1 12:24:11 CET 2017


On 02/24/2017 03:27 AM, Daniel Verkamp wrote:
> 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 at drv.nu>

Reviewed-by: Philippe Mathieu-Daudé <f4bug at amsat.org>

> ---
>  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;
>  }
>
>
>



More information about the SeaBIOS mailing list