[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/block/nvme: map prp fix if prp2 contains non-zero offset
From: |
Keith Busch |
Subject: |
Re: [PATCH] hw/block/nvme: map prp fix if prp2 contains non-zero offset |
Date: |
Fri, 9 Apr 2021 06:38:21 +0900 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Thu, Apr 08, 2021 at 09:53:13PM +0530, Padmakar Kalghatgi wrote:
> + /*
> + * The first PRP list entry, pointed by PRP2 can contain
> + * offsets. Hence, we need calculate the no of entries in
> + * prp2 based on the offset it has.
> + */
This comment has some unnecessary spacing at the beginning.
> + nents = (n->page_size - (prp2 % n->page_size)) >> 3;
page_size is a always a power of two, so let's replace the costly modulo
with:
nents = (n->page_size - (prp2 & (n->page_size - 1))) >> 3;